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
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
1$user = [
2 'email' => 'email',
3 'password' => 'password'
4];
5
6if (Auth::attempt($user))
7{
8 // user is now logged in!
9 // Access user object with Auth::user()
10}
11//@sujay