-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathAppServiceProvider.php
45 lines (37 loc) · 1.04 KB
/
AppServiceProvider.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Name of the field that specifies the owner. It should be the same for all models.
*/
public const OWNER_FIELD = 'owner_id';
public const MIN_PASSWORD_LENGTH = 8;
/**
* Register any application services.
*
* @return void
*/
public function register()
{
if ($this->app->isLocal()) {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
Blade::directive('errorClass', function ($field) {
$ifStatement = "if(session()->has('errors') && session('errors')->has(${field}))";
return "<?php {$ifStatement} echo 'is-invalid'; ?>";
});
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
}
}