diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index dec9c2e5..ec7ff29b 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use View; use Validator; use Illuminate\Support\ServiceProvider; @@ -14,9 +15,7 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - \View::addExtension('tpl', 'blade'); - - require_once BASE_DIR."/app/helpers.php"; + View::addExtension('tpl', 'blade'); Validator::extend('username', function($attribute, $value, $parameters, $validator) { return preg_match("/^([A-Za-z0-9\x{4e00}-\x{9fa5}_]+)$/u", $value); diff --git a/composer.json b/composer.json index 34a2c9f6..797acfc9 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,10 @@ ], "psr-4": { "App\\": "app/" - } + }, + "files": [ + "app/helpers.php" + ] }, "autoload-dev": { "classmap": [