In this tutorial you will learn about the How to Create Custom Route File in Laravel App and its application with practical example.
How to Create Custom Route File in Laravel App
In this How to Create Custom Route File in Laravel App tutorial I’ll show you how to create custom route file in laravel. In this tutorial you will learn to create custom route file in your laravel project. In this step by step tutorial I’ll guide you through the process of creating custom route file in laravel.
Step 1: Install Laravel Fresh Application
First of all we need to create a fresh laravel project, download and install Laravel using the below command
Step 2: Create Custom Route File
In this step we will be creating custom route file. Go to appName/routes folder and create custom routes file. And will create custom routes file name students.php.
routes/student.php
Step 3: Add Files to ServiceProvider
In this step, you need to register your custom routes in Route Service Provider. Go to app/Providers folder and find RouteServiceProvider.php . Open it and register your custom routes file as follow:
Now you can add your routes in student.php route file and use it as follow: