1Route::get('orders', function()
2{
3 return View::make('orders.index')
4 ->with('orders', Order::all());
5});
6//@sujay
1Route::get('logout', function()
2{
3 Auth::logout();
4
5 return Redirect::home();
6});
7//@sujay
1$q->where(function ($query) {
2 $query->where('gender', 'Male')
3 ->where('age', '>=', 18);
4})->orWhere(function($query) {
5 $query->where('gender', 'Female')
6 ->where('age', '>=', 65);
7})
8
9
1Article::find($article_id)->increment('read_count');
2Article::find($article_id)->increment('read_count', 10); // +10
3Product::find($produce_id)->decrement('stock'); // -1
4//@sujay
1{{ Form::model($order) }}
2 <div>
3 {{ Form::label('title', 'Title:') }}
4 {{ Form::text('title') }}
5 </div>
6
7 <div>
8 {{ Form::label('description', 'Description:') }}
9 {{ Form::textarea('description') }}
10 </div>
11{{ Form::close() }}
12//@sujay
1//$user = User::find($id);
2//if (!$user) { abort (404); }
3//=> do this
4$user = User::findOrFail($id);
5//@sujay