如何在没有Eloquent的情况下创建Laravel模型?

As I am not sure, is it possible to create models with DB Class instead of Eloquent? I want to stay away from ORM.

Thanks

Yes of course its possible. You dont need to extend any class to make a model class that encapsulates business logic and consists of methods calling the DB class.

Just create your model inside app/models/MyModel.php like this

class MyModel{

    public static function getMyData(){
         DB::table('users')->select('column')->get();

    }
}

then you should be fine to call your new class statically:

$data = MyModel::getMyData();

If you wanted to extend the DB class you could, though more likely you would be looking to extend the Database/Builder class to extend functionality but this is a complex topic and I suspect you would have asked a very different question if this was what you were after.

As I final note, I wouldn't steer clear of Eloquent, it's the greatest thing about Laravel amongst a lot of other great things

Just remove the "extends Eloquent" and build the queries using the DB class.