jqh 5 éve
szülő
commit
f61ee9d09d

+ 2 - 2
src/Admin.php

@@ -30,11 +30,11 @@ class Admin
     use HasAssets;
 
     /**
-     * The Easy admin version.
+     * The version.
      *
      * @var string
      */
-    const VERSION = '1.0.0';
+    const VERSION = '0.1.0';
 
     /**
      * @var array

+ 6 - 5
src/Controllers/AuthController.php

@@ -15,6 +15,11 @@ use Illuminate\Support\Facades\Validator;
 
 class AuthController extends Controller
 {
+    /**
+     * @var string
+     */
+    protected $view = 'admin::login';
+
     /**
      * @var string
      */
@@ -31,7 +36,7 @@ class AuthController extends Controller
             return redirect($this->redirectPath());
         }
 
-        return view(config('admin.auth.login_view') ?: 'admin::login');
+        return view(config('admin.auth.login_view') ?: $this->view);
     }
 
     /**
@@ -221,10 +226,6 @@ class AuthController extends Controller
      */
     protected function redirectPath()
     {
-        if (method_exists($this, 'redirectTo')) {
-            return $this->redirectTo();
-        }
-
         return $this->redirectTo ?: config('admin.route.prefix');
     }
 

+ 3 - 3
src/Form/Field.php

@@ -909,7 +909,7 @@ class Field implements Renderable
             $this->form instanceof Form
             && $this->form->inModal()
         ) {
-            $this->setDisplay(false);
+            $this->display(false);
         }
 
         return $this;
@@ -1057,7 +1057,7 @@ class Field implements Renderable
      *
      * @return self
      */
-    public function setScript($script)
+    public function script($script)
     {
         $this->script = $script;
 
@@ -1069,7 +1069,7 @@ class Field implements Renderable
      *
      * @return self
      */
-    public function setDisplay(bool $display)
+    public function display(bool $display)
     {
         $this->display = $display;
 

+ 5 - 1
src/Form/Field/HasMany.php

@@ -635,10 +635,14 @@ JS;
      *
      * @throws \Exception
      *
-     * @return \Illuminate\View\View
+     * @return \Illuminate\View\View|string
      */
     public function render()
     {
+        if (! $this->shouldRender()) {
+            return '';
+        }
+
         if ($this->viewMode == 'table') {
             return $this->renderTable();
         }

+ 4 - 0
src/Form/Field/Table.php

@@ -103,6 +103,10 @@ class Table extends HasMany
 
     public function render()
     {
+        if (! $this->shouldRender()) {
+            return '';
+        }
+
         Admin::style(
             <<<'CSS'
 .table-has-many .fields-group .form-group {