laravel tricks and tips
Route::get('orders', function()
{
return View::make('orders.index')
->with('orders', Order::all());
});
//@sujay
laravel tricks and tips
Route::get('orders', function()
{
return View::make('orders.index')
->with('orders', Order::all());
});
//@sujay
laravel tricks and tips
Route::get('logout', function()
{
Auth::logout();
return Redirect::home();
});
//@sujay
laravel tips
$q->where(function ($query) {
$query->where('gender', 'Male')
->where('age', '>=', 18);
})->orWhere(function($query) {
$query->where('gender', 'Female')
->where('age', '>=', 65);
})
laravel tricks and tips
Article::find($article_id)->increment('read_count');
Article::find($article_id)->increment('read_count', 10); // +10
Product::find($produce_id)->decrement('stock'); // -1
//@sujay
laravel tricks and tips
{{ Form::model($order) }}
<div>
{{ Form::label('title', 'Title:') }}
{{ Form::text('title') }}
</div>
<div>
{{ Form::label('description', 'Description:') }}
{{ Form::textarea('description') }}
</div>
{{ Form::close() }}
//@sujay
laravel tricks and tips
//$user = User::find($id);
//if (!$user) { abort (404); }
//=> do this
$user = User::findOrFail($id);
//@sujay
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us