Today, We want to share with you Routing in laravel 6 Web Application Tutorial.In this post we will show you wordpress plugin require another plugin, hear for reverse routing in laravel we will give you demo and example for implement.In this post, we will learn about model view controller in laravel with an example.

Routing in laravel 6 Web Application Tutorial

There are the Following The simple About bootstrap directory in laravel is used to Full Information With Example and source code.

As I will cover this Post with live Working example to develop How to Structure Routes in Large Laravel 6 Projects?, so the functions in laravel controller is used for this example is following below.

READ :  vuejs Introduction hello world example

How to Structure Routes in Large Laravel 6 Projects?

Route::get('/', function(){
	return "welcome";
});

Route::post('loginMember', '[email protected]');
Route::group(['middleware' => ['web']], function () {
	Route::get('member/logout', 'Auth\[email protected]');
	Route::get('member/signin', 'Auth\[email protected]');
	Route::post('auth/signin', 'Auth\[email protected]');
	Route::get('auth/logout', 'Auth\[email protected]');

	Route::group(['middleware' => ['auth']], function () {
		Route::controller('member', 'MemberController');
		Route::get('member/dashboard', '[email protected]');
		Route::get('member/profile', '[email protected]');
		Route::post('member/profile', '[email protected]');

	});
});

Laravel 6 Routing is one of the Best Navigation essential part or concepts in Server side.

Route:: get ('/', function () {
   return 'Welcome to index';
});

Route:: post('member/dashboard', function () {
   return 'Welcome to Member dashboard';
});

Route:: put('member/add', function () {
//
});

Route:: delete('post/action_name', function () {
//
});

Required Parameters

Route :: get ('product/{id}', function ($id) {
    echo 'Product '.$id;
});

Optional Parameters

Route :: get ('product/{slug?}', function ($slug = null) {
    echo $slug;
});

Route :: get ('product/{title?}', function ($title = 'Mobile') {
    echo $title;
});

Laravel 6 Structure routes/web.php File into Groups

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

    Route::get('member/profile', function () {
        // Uses first & second Middleware
    });
});

Route::prefix('member')->group(function () {
    Route::get('students', function () {
        // Matches The "/member/students" URL
    });
});

Route::name('member.')->group(function () {
    Route::get('students', function () {
        // Route assigned name "member.students"...
    })->name('students');
});

 
Route::name('member.')->prefix('member')->middleware('member')->group(function () {
    // ...
});


Route::group([
    'name' => 'member.', 
    'prefix' => 'member', 
    'middleware' => 'auth'
], function () {
    // ...
});

Route::group([
    'name' => 'member.',
    'prefix' => 'member',
    'middleware' => 'member'
], function () {

    Route::get('students', function () {
        return 'Student: student list';
    })->name('students');

});

Route::group([
    'name' => 'student.',
    'prefix' => 'student',
    'middleware' => 'auth'
], function () {

    Route::get('dp', function () {
        return 'Student dp';
    })->name('dp');

});

Route::group([
    'name' => 'backend.',
    'prefix' => 'backend'
], function () {

    Route::get('privacy-us', function () {
        return 'privacy us page';
    })->name('privacy');

});

Web Programming Tutorials Example with Demo

Read :

READ :  jQuery Ajax Image Upload using PHP Example

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about laravel route resource.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.