Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel grouping routes

Route::middleware(['first', 'second'])->group(function () {
    Route::get('/', function () {
        // Uses first & second middleware...
    });

    Route::get('/user/profile', function () {
        // Uses first & second middleware...
    });
});
Comment

laravel route group name

Route::group(['prefix'=>'accounts','as'=>'account.'], function(){
    Route::get('/', ['as' => 'index', 'uses' => 'AccountController@index']);
    Route::get('connect', ['as' => 'connect', 'uses' = > 'AccountController@connect']);
});
Comment

laravel group routes

Route::group(['prefix' => 'admin'], function () {
    Route::get('users', function ()    {
        // Matches The "/admin/users" URL
    });
});
Comment

grouping route in laravel

Route::group(['middleware' => ['auth', 'checkOnboarding']], function () {
    Route::get('/home', 'HomeController@index');
    Route::get('/account', 'AccountController@index');
});

Route::group(['prefix' => 'setup', 'middleware' => 'auth'], function () {
    Route::get('/', 'OnboardingController@index')->name('setup');
    Route::post('/settings', 'SettingsController@store');
});
Comment

grouping routes based on controller laravel

use AppHttpControllersAdminAdminController;
Route::controller(AdminController::class)->group(function(){
    Route::get('admin/dashboard', 'dashboard');
    Route::get('admin/test', 'test');
});
Comment

grouping route in laravel

Route::group(['middleware' => 'auth'], function () {

    Route::group(['middleware' => 'checkOnboarding'], function () {
        Route::get('/home', 'HomeController@index');
        Route::get('/account', 'AccountController@index');
    });

    Route::group(['prefix' => 'setup'], function () {
        Route::get('/', 'OnboardingController@index')->name('setup');
        Route::post('/settings', 'SettingsController@store');
    });
});
Comment

PREVIOUS NEXT
Code Example
Php :: get contents of a tmp file php 
Php :: php get age from dob 
Php :: Command "route:scan" is not defined. 
Php :: how to add properties to the request object 
Php :: php header 500 
Php :: center mode slick slider 
Php :: remove gutenberg styles 
Php :: wordpress custom fields variable dump 
Php :: new line in php 
Php :: php check if extension is installed 
Php :: php artisan serve a folder 
Php :: how to create a new component in laravel 
Php :: laravel helper function for check string is exist in another string 
Php :: year in php 
Php :: laravel plural and singular 
Php :: include a website in php file 
Php :: how to add shortcode in html 
Php :: get the value of href in string php 
Php :: block direct access to php images 
Php :: composer_memory_limit 
Php :: transaction cakephp 2 
Php :: Error: Call to a member function getClientOriginalName() on null in file /usr/local/var/www/murabaha_backend/app/Http/Controllers/Traits/MediaUploadingTrait.php 
Php :: php get end date of month 
Php :: php merge 2 arrays 
Php :: send sms by php diafaan 
Php :: Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 119541600 bytes) in C:xampphtdocsackup-vice.php on line 67 
Php :: Call to undefined function mysql_connect() 
Php :: remove spaces from string php 
Php :: laravel gigapay create payout 
Php :: php redirect after specific seconds 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =