osherdo Posted November 13, 2015 Share Posted November 13, 2015 (edited) Hi I am wondering what this code snippet means. I would appreciate you help ,please. Please note that it is taken from Laravel's website. (written in a bit different php code). public function index() { $flights = Flight::all(); return view('flight.index', ['flights' => $flights]); } } Thanks. Edited November 13, 2015 by osherdo Quote Link to comment https://forums.phpfreaks.com/topic/299476-code-snippet-review/ Share on other sites More sharing options...
QuickOldCar Posted November 14, 2015 Share Posted November 14, 2015 It's a public function that accesses a class to return specific results anywhere you need to. 1 Quote Link to comment https://forums.phpfreaks.com/topic/299476-code-snippet-review/#findComment-1526368 Share on other sites More sharing options...
Solution maxxd Posted November 14, 2015 Solution Share Posted November 14, 2015 I don't know Laravel, but it certainly looks like a function that gets all the data from a table called Flight, then passes that data to a template file that is rendered to the user. 1 Quote Link to comment https://forums.phpfreaks.com/topic/299476-code-snippet-review/#findComment-1526399 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.