https://github.com/nejcc/laravelscope-docs
https://github.com/nejcc/laravelscope-docs
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nejcc/laravelscope-docs
- Owner: Nejcc
- Created: 2021-09-03T18:51:08.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-03T18:58:18.000Z (almost 5 years ago)
- Last Synced: 2025-08-07T02:40:57.669Z (10 months ago)
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Create new Admin route
Inside routes folder make new Admin.php rout file
#### RouteServiceProvider
[https://laravel.com/docs/8.x/routing](Laravel documentation 8.x)
```php
public function boot()
{
$this->configureRateLimiting();
$this->routes(function () {
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
//Adding new custom route here
});
}
```
#### Append new route group
##### Simple route
```php
//Adding new custom route
Route::middleware(['web', 'auth'])
->namespace($this->namespace)
->prefix('admin')
->name('admin.')
->group(base_path('routes/admin.php'));
```
##### Advanced route with Roles
```php
Route::middleware(['web', 'auth', 'role:admin|super-admin'])
->namespace($this->namespace)
->prefix('admin')
->name('admin.')
->group(base_path('routes/admin.php'));
```
##### Create new Admin route
```
touch routes/Admin.php
```
##### Create your first index route name
Create new controller
```
php artisan make:controller Admin/DashboardController
```
##### Add new route to Admin route
```php
Route::get('/', [App\Http\Controllers\Admin\DashboardController::class, 'index'])->name('dashboard');
```