Ларев мягкие удаления
Schema::table('flights', function (Blueprint $table) {
$table->softDeletes();
});
Alberto Peripolli
Schema::table('flights', function (Blueprint $table) {
$table->softDeletes();
});
SET configuration variables at runtime:
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
View::share('key', 'value');
Schema::defaultStringLength(191);
$company=DB::table('company')->where('id',1)->first();
config(['yourconfig.company' => $company]);
}
}
USE:
config('yourconfig.company');
public function boot()
{
parent::boot();
Route::bind('project', function($id) {
return \App\Project::withoutGlobalScopes()->findOrFail($id);
});
}
$user = User::where('mobile', Input::get('mobile'))->get();
if (!$user->isEmpty()){
$firstUser = $user->first()
}
Model::withoutGlobalScopes()->get();
protected static function boot()
{
parent::boot();
static::addGlobalScope(new ArchiveScope);
}