DEV Community

Cover image for Routing in Laravel
Younes Noorzahi
Younes Noorzahi

Posted on

Routing in Laravel

πŸ”₯ A Quick Introduction to Routes in Laravel + Free Practical Project
In the world of backend development with the popular Laravel framework, Routes play the role of the backbone of incoming requests. If you are new to the world of Laravel or would like to quickly review it, this short post will help you.


πŸ“Œ What is a Route?

In Laravel, Routes help us define how our application should respond when a user calls a URL through a browser.

Simple example:

Route::get('/about', function () {
    return 'This is About Page';
});
Enter fullscreen mode Exit fullscreen mode

πŸ“ Types of Routes in Laravel

  • Route::get() : To receive data
  • Route::post() : To send data (forms)
  • Route::put() : To edit data
  • Route::delete() : To delete data

πŸ› οΈ Grouped Routes

Laravel allows you to group routes:

Route::prefix('admin')->group(function () {
    Route::get('/dashboard', [DashboardController::class, 'index']);
});
Enter fullscreen mode Exit fullscreen mode

🎯 Complete Project for Practice

I created a complete project using Laravel API Routes and JWT authentication that you can use for free and learn how to:

  • Create API Routes,
  • Implement authentication and protection of Routes,
  • and develop a real RESTful API.

πŸ‘‰ View the full project source code here:
⭐ View the project on my GitHub


πŸ’¬ I would be happy if you would write me your opinion in the comments, or fork the project and start it.
Let's learn and improve together! πŸš€


πŸ”” Follow me for more projects:

My GitHub: github.com/younesnoorzahi

Top comments (0)