Selaa lähdekoodia

Merge remote-tracking branch 'github/2.0' into github

jqh 4 vuotta sitten
vanhempi
commit
d2c718871b
4 muutettua tiedostoa jossa 24 lisäystä ja 3 poistoa
  1. 1 1
      src/Form/Builder.php
  2. 10 2
      src/Form/Field.php
  3. 8 0
      src/Form/Field/SelectTable.php
  4. 5 0
      src/Grid/Column/Condition.php

+ 1 - 1
src/Form/Builder.php

@@ -631,7 +631,7 @@ class Builder
             $this->addHiddenField((new Hidden('_method'))->value('PUT'));
         }
 
-        $this->addHiddenField((new Hidden('_token'))->value(csrf_token()));
+        $this->addHiddenField((new Hidden('_token'))->value((string) csrf_token()));
 
         $this->addRedirectUrlField();
 

+ 10 - 2
src/Form/Field.php

@@ -537,7 +537,7 @@ class Field implements Renderable
      *
      * @param null $value
      *
-     * @return mixed
+     * @return mixed|$this
      */
     public function value($value = null)
     {
@@ -821,7 +821,7 @@ class Field implements Renderable
     public function placeholder($placeholder = null)
     {
         if ($placeholder === null) {
-            return $this->placeholder ?: trans('admin.input').' '.$this->label;
+            return $this->placeholder ?: $this->defaultPlaceholder();
         }
 
         $this->placeholder = $placeholder;
@@ -829,6 +829,14 @@ class Field implements Renderable
         return $this;
     }
 
+    /**
+     * @return string
+     */
+    protected function defaultPlaceholder()
+    {
+        return trans('admin.input').' '.$this->label;
+    }
+
     /**
      * @param mixed $value
      *

+ 8 - 0
src/Form/Field/SelectTable.php

@@ -145,6 +145,14 @@ class SelectTable extends Field
         $this->options = $values;
     }
 
+    /**
+     * @return string
+     */
+    protected function defaultPlaceholder()
+    {
+        return trans('admin.choose').' '.$this->label;
+    }
+
     protected function setUpTable()
     {
         $this->dialog

+ 5 - 0
src/Grid/Column/Condition.php

@@ -70,6 +70,11 @@ class Condition
         }
     }
 
+    public function end()
+    {
+        return $this->column;
+    }
+
     protected function callCallbacks(array $callbacks)
     {
         if (! $callbacks) {