@shanely Yes, the fluent interface with line breaks won't work on the command line. You'd have to put a backslash at the end of each but the last line but then it won't work in your IDE.
You can put it on a single line like in my example. That would look like
$flights = App\Flight::where('active', 1)->orderBy('name', 'desc')->take(10)->get();
That works in both the IDE and (copy/paste) on the command line.
Or try this instead:
$q = App\Flight::where('active', 1);
$q->orderBy('name', 'desc');
$q->take(10);
$flights = $q->get();
Doesn't look that nice but I like to build the query step by step on the command line until it works as it is supposed to. And when the query works just remove the intermediate object ($q) and the extra semicolons in order to get the fluent interface back if you prefer that.