Naming Resource Routes
By default, all resource controller actions have a route name; however, you can override these names by passing a names
array with your options:
Route::resource('photos', 'PhotoController')->names([
'create' => 'photos.build'
]);
All the methods of the controller have a default route name, but Laravel allows you to override the route names by passing name array. Name array contains the name of the routes that you want to specify of your choice.
For Example(1)
We can add the below code in web.php file to name the resource routes.
Route::resource('demo', 'demoController',['names' => ['create' =>'demo.build']]);