The eloquent queries like
$flight = App\Flight::find(1);
$flight->name = 'New Flight Name';
$flight->save();
is written in controller file. Why this not in model file. I am asking because models are meant for database operations.isn't it?
Here is an excerpt from laravel documentation as to what is an eloquent model-
Each database table has a corresponding "Model" which is used to interact with that table. Models allow you to query for data in your tables, as well as insert new records into the table.
What it means is that, a model file simply is the class representation of a table in the database.
For example App\Flight is a class corresponding to Flights table, hence you can write eloquent queries using the Flight class.
Relations between different tables are also defined in a model file.
Controller is the file where you actually use the models to query the database and write core logic. Think of controllers as acting as an intermediary between database and view.
Hope if clears the concept :)