jqh 5 éve
szülő
commit
ee04040e2a
6 módosított fájl, 27 hozzáadás és 23 törlés
  1. 9 15
      src/Admin.php
  2. 1 1
      src/AdminServiceProvider.php
  3. 1 1
      src/Console/AdminCommand.php
  4. 1 0
      src/Form.php
  5. 5 6
      src/Tree.php
  6. 10 0
      src/Widgets/Form.php

+ 9 - 15
src/Admin.php

@@ -61,7 +61,7 @@ class Admin
      *
      * @return string The long application version
      */
-    public static function getLongVersion()
+    public static function longVersion()
     {
         return sprintf('Dcat Admin <comment>version</comment> <info>%s</info>', static::VERSION);
     }
@@ -83,23 +83,17 @@ class Admin
     }
 
     /**
-     * Set admin title.
+     * Get or set admin title.
      *
-     * @return void
+     * @return string|void
      */
-    public static function setTitle($title)
+    public static function title($title = null)
     {
-        static::$metaTitle = $title;
-    }
+        if ($title === null) {
+            return static::$metaTitle ?: config('admin.title');
+        }
 
-    /**
-     * Get admin title.
-     *
-     * @return string
-     */
-    public static function title()
-    {
-        return static::$metaTitle ?: config('admin.title');
+        static::$metaTitle = $title;
     }
 
     /**
@@ -368,7 +362,7 @@ class Admin
      *
      * @return Extension[]
      */
-    public static function getAvailableExtensions()
+    public static function availableExtensions()
     {
         if (static::$availableExtensions !== null) {
             return static::$availableExtensions;

+ 1 - 1
src/AdminServiceProvider.php

@@ -156,7 +156,7 @@ class AdminServiceProvider extends ServiceProvider
      */
     public function registerExtensionProviders()
     {
-        foreach (Admin::getAvailableExtensions() as $extension) {
+        foreach (Admin::availableExtensions() as $extension) {
             if ($provider = $extension->serviceProvider()) {
                 $this->app->register($provider);
             }

+ 1 - 1
src/Console/AdminCommand.php

@@ -42,7 +42,7 @@ LOGO;
     public function handle()
     {
         $this->line(static::$logo);
-        $this->line(Admin::getLongVersion());
+        $this->line(Admin::longVersion());
 
         $this->comment('');
         $this->comment('Available commands:');

+ 1 - 0
src/Form.php

@@ -275,6 +275,7 @@ class Form implements Renderable
      *
      * @param Repository|Model|\Illuminate\Database\Eloquent\Builder|string $model
      * @param \Closure                                                      $callback
+     * @param Request                                                       $request
      */
     public function __construct($repository = null, ?Closure $callback = null, Request $request = null)
     {

+ 5 - 6
src/Tree.php

@@ -235,7 +235,7 @@ class Tree implements Renderable
      *
      * @return $this
      */
-    public function setdialogFormDimensions(string $width, string $height)
+    public function setDialogFormDimensions(string $width, string $height)
     {
         $this->dialogFormDimensions = [$width, $height];
 
@@ -557,13 +557,12 @@ JS;
     /**
      * Create a tree instance.
      *
-     * @param Model|null   $model
-     * @param Closure|null $callback
+     * @param mixed ...$param
      *
-     * @return Tree
+     * @return $this
      */
-    public static function make(Model $model = null, \Closure $callback = null)
+    public static function make(...$param)
     {
-        return new static($model, $callback);
+        return new static(...$param);
     }
 }

+ 10 - 0
src/Widgets/Form.php

@@ -682,4 +682,14 @@ JS
     {
         return $this->render();
     }
+
+    /**
+     * @param mixed ...$params
+     *
+     * @return $this
+     */
+    public static function make(...$params)
+    {
+        return new static(...$params);
+    }
 }