add route web.php
parent
fe7f1276d8
commit
bea4d94338
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Peidikeji\Keywords\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::group(['middleware' => 'api', 'prefix' => 'api'], function () {
|
||||
Route::get('keywords', [KeywordsController::class, 'json']);
|
||||
});
|
||||
|
|
@ -391,13 +391,16 @@ abstract class ServiceProvider extends LaravelServiceProvider
|
|||
*/
|
||||
public function registerRoutes($callback)
|
||||
{
|
||||
// $this->loadRoutesFrom($callback);
|
||||
Admin::app()->routes(function ($router) use ($callback) {
|
||||
$router->group([
|
||||
'prefix' => config('admin.route.prefix'),
|
||||
'middleware' => config('admin.route.middleware'),
|
||||
], $callback);
|
||||
});
|
||||
$webRoute = $this->getRoutes('web.php');
|
||||
if ($webRoute) {
|
||||
$this->loadRoutesFrom($webRoute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -485,9 +488,9 @@ abstract class ServiceProvider extends LaravelServiceProvider
|
|||
*
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
final public function getRoutes()
|
||||
final public function getRoutes($name = 'routes.php')
|
||||
{
|
||||
$path = $this->path('src/Http/routes.php');
|
||||
$path = $this->path('src/Http/' . $name);
|
||||
|
||||
return is_file($path) ? $path : null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue