jqh 4 سال پیش
والد
کامیت
50d70c05f8
2فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 1 0
      src/Admin.php
  2. 4 4
      src/Application.php

+ 1 - 0
src/Admin.php

@@ -207,6 +207,7 @@ class Admin
         $attributes = [
             'prefix'     => config('admin.route.prefix'),
             'middleware' => config('admin.route.middleware'),
+            'as'         => static::app()->getName().'.',
         ];
 
         if (config('admin.auth.enable', true)) {

+ 4 - 4
src/Application.php

@@ -81,7 +81,7 @@ class Application
         if ($this->apps) {
             $this->registerMultiAppRoutes();
 
-            $this->withConfig(static::DEFAULT);
+            $this->switch(static::DEFAULT);
         }
     }
 
@@ -97,13 +97,13 @@ class Application
         if ($this->apps) {
             foreach ($this->apps as $app => $enable) {
                 if ($enable) {
-                    $this->withConfig($app);
+                    $this->switch($app);
 
                     $this->loadRoutesFrom($pathOrCallback, $app);
                 }
             }
 
-            $this->withConfig(static::DEFAULT);
+            $this->switch(static::DEFAULT);
         }
     }
 
@@ -141,7 +141,7 @@ class Application
      */
     protected function registerRoute(?string $app)
     {
-        $this->withConfig($app);
+        $this->switch($app);
 
         $this->loadRoutesFrom(function () use ($app) {
             Admin::registerApiRoutes($this->getApiRoutePrefix($app));