laravel-routing

Routing Error Due to a group prefix in my route

廉价感情. 提交于 2020-08-20 12:10:31
问题 In my routing if i remove the {page} prefix it works completely fine but when i put it i get an error. For other it is working fine but it is not working for this route: Route::get('/{categories}', 'AdminVisible\CostIncludeController@index'); My AdminPageController: public function index($page) { $page = Page::where('Pages_Slug_Name',$page)->firstorFail(); $pages = Page::all(); return view('admin.pages.page',[ 'page' => $page, ],compact('pages')); } My CostIncludeController: public function

Routing Error Due to a group prefix in my route

风流意气都作罢 提交于 2020-08-20 12:09:24
问题 In my routing if i remove the {page} prefix it works completely fine but when i put it i get an error. For other it is working fine but it is not working for this route: Route::get('/{categories}', 'AdminVisible\CostIncludeController@index'); My AdminPageController: public function index($page) { $page = Page::where('Pages_Slug_Name',$page)->firstorFail(); $pages = Page::all(); return view('admin.pages.page',[ 'page' => $page, ],compact('pages')); } My CostIncludeController: public function

Routing Error Due to a group prefix in my route

谁说胖子不能爱 提交于 2020-08-20 12:09:01
问题 In my routing if i remove the {page} prefix it works completely fine but when i put it i get an error. For other it is working fine but it is not working for this route: Route::get('/{categories}', 'AdminVisible\CostIncludeController@index'); My AdminPageController: public function index($page) { $page = Page::where('Pages_Slug_Name',$page)->firstorFail(); $pages = Page::all(); return view('admin.pages.page',[ 'page' => $page, ],compact('pages')); } My CostIncludeController: public function

Can route model binding be used with RESTful controllers?

僤鯓⒐⒋嵵緔 提交于 2020-08-19 06:33:08
问题 I have been using RESTful controllers in my Laravel project. By including: Route::controller('things', 'ThingController') in my routes.php, I can define functions in the ThingController like: public function getDisplay($id) { $thing = Thing::find($id) ... } so that GETting the URL "...things/display/1" would automatically be directed to the controller function. This seems pretty handy and has been working great for me so far. I noticed many of my controller functions start with getting a

Assigning one route to multiple user without a package in laravel

蹲街弑〆低调 提交于 2020-08-02 04:44:27
问题 I have created four user type admin,vendor,employee,customer . In the user migration file I have the following: public function up() { Schema::create('users', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name'); $table->string('email')->unique(); $table->char('contact',24)->nullable(); $table->string('password'); $table->enum('roles',['admin', 'vendor', 'employee', 'customers']); $table->string('image')->nullable(); $table->timestamps(); }); } I have already

Assigning one route to multiple user without a package in laravel

房东的猫 提交于 2020-08-02 04:43:45
问题 I have created four user type admin,vendor,employee,customer . In the user migration file I have the following: public function up() { Schema::create('users', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name'); $table->string('email')->unique(); $table->char('contact',24)->nullable(); $table->string('password'); $table->enum('roles',['admin', 'vendor', 'employee', 'customers']); $table->string('image')->nullable(); $table->timestamps(); }); } I have already