jqh пре 5 година
родитељ
комит
991f0baba4

+ 5 - 1
resources/views/grid/dropdown-actions.blade.php

@@ -9,7 +9,11 @@
         @endforeach
 
         @if(!empty($custom))
-            <li class="divider"></li>
+
+            @if(!empty($default))
+                <li class="divider"></li>
+            @endif
+
             @foreach($custom as $action)
                 <li>{!! $action !!}</li>
             @endforeach

+ 2 - 0
src/Controllers/UserController.php

@@ -176,6 +176,8 @@ class UserController extends Controller
         $show->username;
         $show->name;
 
+        $show->avatar->image();
+
         $show->newline();
 
         $show->created_at;

+ 4 - 0
src/Form.php

@@ -293,6 +293,10 @@ class Form implements Renderable
 
         $this->builder->fields()->push($field);
 
+        $width = $this->builder->getWidth();
+
+        $field->setWidth($width['field'], $width['label']);
+
         $field::collectAssets();
 
         return $this;

+ 3 - 1
src/Show/Tools.php

@@ -194,7 +194,9 @@ class Tools implements Renderable
      */
     protected function getListPath()
     {
-        return '/'.ltrim($this->getResource(), '/');
+        $url = $this->getResource();
+
+        return url()->isValidUrl($url) ? $url : '/'.trim($url, '/');
     }
 
     /**

+ 15 - 0
src/Widgets/Form.php

@@ -106,6 +106,14 @@ class Form implements Renderable
      */
     protected $formId;
 
+    /**
+     * @var array
+     */
+    protected $width = [
+        'label' => 2,
+        'field' => 8,
+    ];
+
     /**
      * Form constructor.
      *
@@ -271,6 +279,11 @@ class Form implements Renderable
      */
     public function setWidth($fieldWidth = 8, $labelWidth = 2)
     {
+        $this->width = [
+            'label' => $labelWidth,
+            'field' => $fieldWidth,
+        ];
+
         collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) {
             /* @var Field $field  */
             $field->setWidth($fieldWidth, $labelWidth);
@@ -308,6 +321,8 @@ class Form implements Renderable
     {
         array_push($this->fields, $field);
 
+        $field->setWidth($this->width['field'], $this->width['label']);
+
         $field::collectAssets();
 
         return $this;