/**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     parent::register();
     $configPath = realpath(__DIR__ . '/../config/UEditorUpload.php');
     $this->mergeConfigFrom($configPath, 'UEditorUpload');
     $this->publishes([$configPath => config_path('UEditorUpload.php')], 'config');
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     parent::boot($router);
     $router->bind('articles', function ($id) {
         $article = Article::findOrFail($id);
         // If the owner return all articles else return only published.
         if (Auth::user() && $article->user_id === Auth::user()->id) {
             $articles = Article::findOrFail($id);
         } else {
             $articles = Article::published()->findOrFail($id);
         }
         return $articles;
     });
     $router->bind('questions', function ($id) {
         return Question::findOrFail($id);
     });
     $router->bind('answers', function ($id) {
         return Answer::findOrFail($id);
     });
     $router->bind('tags', function ($name) {
         return Tag::where('name', $name)->firstOrFail();
     });
     $router->bind('users', function ($id) {
         return User::findOrFail($id);
     });
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     // bind article
     $router->model('article', 'App\\Article');
     $router->bind('admin.article', function ($id) {
         return \App\Article::findOrFail($id);
     });
     // bind category
     $router->model('category', 'App\\Category');
     $router->bind('admin.category', function ($id) {
         return \App\Category::findOrFail($id);
     });
     // bind language
     $router->model('language', 'App\\Language');
     $router->bind('admin.language', function ($id) {
         return \App\Language::findOrFail($id);
     });
     // bind language
     $router->model('page', 'App\\Page');
     $router->bind('admin.page', function ($id) {
         return \App\Page::findOrFail($id);
     });
     // bind setting
     $router->model('setting', 'App\\Setting');
     $router->bind('admin.setting', function ($id) {
         return \App\Setting::findOrFail($id);
     });
     // bind user
     $router->model('user', 'App\\User');
     $router->bind('admin.user', function ($id) {
         return \App\User::findOrFail($id);
     });
     parent::boot($router);
 }
Esempio n. 4
0
 /**
  * ルートモデル結合、パターンフィルターなどを定義
  *
  * @param  \Illuminate\Routing\Router $router
  * @return void
  */
 public function boot(Router $router)
 {
     $router->model('textDiary', TextDiary::class);
     $router->model('workDiary', WorkDiary::class);
     $router->model('workRecord', WorkRecord::class);
     parent::boot($router);
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     $router->pattern('board', Board::URI_PATTERN);
     $router->model('board', 'App\\Board');
     $router->model('role', 'App\\Role');
     parent::boot($router);
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param \Illuminate\Routing\Router $router
  *
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     // TODO require this as soon as there is something to import
     // -- otherwise artisan will error with an parse error
     //require  __DIR__ . '/../Http/breadcrumbs.php';
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     $router->pattern('id', '[0-9]+');
     // Should handle 32n33-sss-img-dd.png exception
     $router->pattern('image', '(?P<parent>[0-9n]{2,5}-[\\pL-\\pN\\._-]+)-(?P<suffix>img-[0-9]{2}.png)');
     parent::boot($router);
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     $router->bind('username', function ($username) {
         return User::whereName($username)->firstOrFail();
     });
 }
 /**
  * {@inheritdoc}
  */
 public function boot(Router $router = null)
 {
     $this->publishes([dirname(__DIR__) . '/config/routes.php' => $this->app->make('path.config') . '/routes.php'], 'config');
     $this->binders = $this->app->call([$this, 'makeBinders']);
     $this->app->call([$this, 'bind']);
     parent::boot($router);
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     $router->bind('attendees', function ($id) {
         return \App\Attendee::where('id', $id)->firstOrFail();
     });
     parent::boot($router);
 }
Esempio n. 11
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     $router->bind('user', function ($value) {
         //return User::where('name', $value)->first();
     });
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     parent::boot($router);
     // DATABIDING, permet d'utiliser les objets à tous moment grâce au DATABIDING ex : user
     $router->model('users', 'App\\Users', function () {
         App::abort(500);
     });
     $router->model('roles_users', 'App\\Roles_users', function () {
         App::abort(500);
     });
     $router->model('langues', 'App\\Langues', function () {
         App::abort(500);
     });
     $router->model('pays', 'App\\Pays', function () {
         App::abort(500);
     });
     $router->model('ville', 'App\\Villes', function () {
         App::abort(500);
     });
     $router->model('actu', 'App\\Actu', function () {
         App::abort(500);
     });
     $router->model('notification', 'App\\NotificationHistory', function () {
         App::abort(500);
     });
 }
Esempio n. 13
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     parent::boot($router);
     // For route model binding
     //Route::model()
     //This is ok for small projects
     //for larger projects
     //we can pass a closure for a detailed result
     //
     //For ex
     //
     //$router->bind('articles',function($id)
     //{
     //  return reddev\Article::published()->find($id);
     //});
     //
     //first parameter <articles> is the wildcard being
     //used in the routes, can be checked from route:list command
     //
     //$id is the ID being used
     $router->model('articles', 'reddev\\Article');
     $router->model('users', 'reddev\\User');
     $router->model('pages', 'reddev\\Page');
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     parent::boot($router);
     /**
      * Binding the model
      */
     // $router->model('articles', 'App\Article');
     /**
      * Optional custom bind
      */
     $router->bind('articles', function ($id) {
         /**
          * Show only the published articles
          */
         return \App\Article::published()->findOrFail($id);
     });
     // $router->model('tags', 'App\Tag');
     $router->bind('tags', function ($name) {
         /**
          * Show only the related same tag by name
          */
         return \App\Tag::where('name', $name)->firstOrFail();
     });
 }
Esempio n. 15
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     $router->bind('articles', function ($id) {
         return Article::published()->findOrFail($id);
     });
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     parent::boot($router);
     $router->model('donations', 'App\\Donations');
     $router->model('contribution', 'App\\Contribution');
 }
Esempio n. 17
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     parent::boot($router);
     $router->model('diary', 'App\\Diary');
     $router->model('notes', 'App\\Note');
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     //        $router->model('category', 'CodeCommerce\Category');
     //
     //        $router->model('products', 'CodeCommerce\Product');
 }
Esempio n. 19
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     \Route::bind('category', function ($value) {
         return \App\Model\Option::where('id', $value)->first();
     });
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     parent::boot($router);
     //$router->model('subjects', 'Scholrs\Subject');
     //$router->model('students', 'Scholrs\Student');
 }
Esempio n. 21
0
 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot(Router $router)
 {
     $this->loadViewsFrom(__DIR__ . '/views', 'jiracal');
     $this->publishes([__DIR__ . '/views' => resource_path('views/vendor/jiracal')], 'views');
     $this->publishes([__DIR__ . '/config/jiracal.php' => config_path('jiracal.php')], 'config');
     parent::boot($router);
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     // $router->model('content', 'App\Models\Content');
     // $router->model('type', 'App\Models\Type');
     // $router->model('category', 'App\Models\Category');
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     parent::boot($router);
     $router->model('posts', 'App\\Post');
     $router->model('tags', 'App\\Tag');
 }
Esempio n. 24
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param \Illuminate\Routing\Router $router
  */
 public function boot(Router $router)
 {
     $this->app->setLocale($this->app['currentLocale']->determine());
     $this->registerMacros($router);
     $this->app['paginateroute']->registerMacros();
     parent::boot($router);
 }
Esempio n. 25
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param \Illuminate\Routing\Router $router
  *
  * @return void
  */
 public function boot(Router $router)
 {
     //
     parent::boot($router);
     $router->model('users', 'App\\User', function () {
         throw new UserNotFoundException();
     });
     $router->model('regions', 'App\\Region', function () {
         throw new RegionNotFoundException();
     });
     $router->model('provision_types', 'App\\ProvisionType', function () {
         throw new ProvisionTypeNotFoundException();
     });
     $router->model('funds', 'App\\Fund', function () {
         throw new FundNotFoundException();
     });
     $router->model('providers', 'App\\Provider', function () {
         throw new ProviderNotFoundException();
     });
     $router->model('organisation_types', 'App\\OrganisationType', function () {
         throw new OrganisationTypeNotFoundException();
     });
     $router->model('locations', 'App\\Location', function () {
         throw new LocationNotFoundException();
     });
     $router->model('countries', 'App\\Country', function () {
         throw new CountryNotFoundException();
     });
 }
Esempio n. 26
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     parent::boot($router);
     $router->model('rates', 'App\\Rate');
     $router->model('contracts', 'App\\Contract');
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     $router->bind('client', function ($value, $route) {
         $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20);
         $id = $hashids->decode($value)[0];
         return Client::findOrFail($id);
     });
     $router->bind('bank', function ($value, $route) {
         $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20);
         $id = $hashids->decode($value)[0];
         return BankDetail::findOrFail($id);
     });
     $router->bind('address', function ($value, $route) {
         $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20);
         $id = $hashids->decode($value)[0];
         return Address::findOrFail($id);
     });
     $router->bind('property', function ($value, $route) {
         $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20);
         $id = $hashids->decode($value)[0];
         return Property::findOrFail($id);
     });
     $router->bind('agreement', function ($value, $route) {
         $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20);
         $id = $hashids->decode($value)[0];
         return RentalAgreement::findOrFail($id);
     });
     //
 }
Esempio n. 28
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     $router->bind('posts', function ($value) {
         return Post::findBySlugOrIdOrFail($value);
     });
     parent::boot($router);
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     // Allow only "en" and "fr" locales
     $router->pattern('current_locale', 'en|fr');
     parent::boot($router);
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     //
     $router->pattern('user', '[0-9]+');
     $router->pattern('id', '[0-9]+');
     parent::boot($router);
 }