Everything you need to know will be here :)
kindly take a look at this one http://laravel.com/docs/5.0/queries#selects and http://laravel.com/docs/5.0/eloquent#basic-usage
$accounts = DB::table('users')->where('username', $username)->get();
please take note that whatever you do on query builder, you can do on Eloquent.
beanmoss said:
kindly take a look at this one http://laravel.com/docs/5.0/queries#selects and http://laravel.com/docs/5.0/eloquent#basic-usage
$accounts = DB::table('users')->where('username', $username)->get();
please take note that whatever you do on query builder, you can do on Eloquent.
I've seen similar ones to that, and to display it am I able to after that query do return $accounts and use {{ $accounts }} in my view?
you can use this on your route or Controller to pass data to your views:
return view('accounts.index', ['accounts' => $accounts]);
beanmoss said:
you can use this on your route or Controller to pass data to your views:
return view('accounts.index', ['accounts' => $accounts]);
I use
return view('accounts.index', compact('accounts'));
Download the code from this post and look it over. ====
http://laravel.io/forum/05-02-2015-laravel-5-fundamental-source-code
jimgwhit said:
Download the code from this post and look it over. ====
http://laravel.io/forum/05-02-2015-laravel-5-fundamental-source-code
Does that source make use of MySQL queries so that I am able to compare the Laravel methods and find out how they work?
I believe so, but if you query things exactly the way the Laravel 5 docs show, these will be correct for mysql. Look at eloquent and the query builder section of the docs and practice some simple queries at first.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community