Hey guys !
I have a very specific question about generating a query in laravel , Below is my question .
Suppose i have the following table :
[ATTACH]16623[/ATTACH]
now suppose i have the following code in my controller :
[CODE]public function getIndex(){
$this->layout->content = View::make(‘test.index’)
->with(‘snippets’ , Testing::take(2)->orderBy(‘id’,’desc’)->get());
}
see how it is passing a variable snippets to the view , with i cn iterate over by using a for Each loop .
now want i want to do is , i want to write a query that fetches only Rakesh from the coloumb name .
I need help with the following :
– Firstly ,can somebody tell me roughtly what the query would look like– Secoundly , can somebody tell me how can i prepend/append a new variable and query to the existing controller code .
Thanks .
Gautam .
[canned-message]attachments-removed-during-migration