fatkocc https://prnt.sc/Fvyi80abFra5 Aslında çözdüm diyebilirim şuanda. Ama liste de route:list yaptığım da listelenen rota buraya eklenince not defined veriyor kafayı yiyorum şuanda
Bir de route provider var oraya da ekledim bu web.php nin yolunu
Fakat inatla rotayı görmüyor
<?php
use Botble\Base\Facades\AdminHelper;
use Illuminate\Support\Facades\Route;
Route::group(['namespace' => 'Botble\Demo\Http\Controllers', 'middleware' => ['web', 'core']], function () {
Route::get('admin/demo', 'DemoController@index')->name('brlt.index');
});
<?php
namespace Botble\Demo\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
protected $namespace = 'Botble\Demo\Http\Controllers';
public function boot(): void
{
parent::boot();
}
public function map(): void
{
$this->mapWebRoutes();
}
protected function mapWebRoutes(): void
{
Route::middleware('web')
->namespace($this->namespace)
->group(plugin_path('demo/routes/web.php'));
}
}
<?php
namespace Botble\Demo\Providers;
use Botble\Demo\Providers\RouteServiceProvider;
use Botble\Base\Facades\DashboardMenu;
use Botble\Base\Traits\LoadAndPublishDataTrait;
use Botble\Theme\Events\RenderingAdminBar;
use Botble\Theme\Facades\AdminBar;
use Illuminate\Support\ServiceProvider;
class DemoServiceProvider extends ServiceProvider
{
use LoadAndPublishDataTrait;
public function register(): void
{
$this->app->register(RouteServiceProvider::class);
}
public function boot(): void
{
$this
->setNamespace('plugins/demo')
->loadAndPublishConfigurations(['permissions', 'general'])
->loadHelpers()
->loadRoutes(['web'])
->loadAndPublishViews()
->loadAndPublishTranslations()
->loadMigrations()
->publishAssets();
$this->registerMenu();
$this->registerAdminBarLinks();
}
protected function registerMenu(): void
{
DashboardMenu::registerItem([
'id' => 'cms-plugins-demo',
'priority' => 5,
'parent_id' => null,
'name' => 'plugins/demo::demo.name',
'icon' => 'fas fa-puzzle-piece',
'url' => route('brlt.index'),
'permissions' => ['demo.index'],
]);
}
protected function registerAdminBarLinks(): void
{
$this->app['events']->listen(RenderingAdminBar::class, function () {
AdminBar::registerLink(
trans('plugins/demo::demo.name'),
route('brlt.index'),
'appearance',
'demo.index'
);
});
}
}