|
@@ -110,86 +110,6 @@ class Admin
|
|
|
static::$favicon = $favicon;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @param $repository
|
|
|
- * @param Closure|null $callback
|
|
|
- *
|
|
|
- * @return Grid
|
|
|
- */
|
|
|
- public static function grid($repository = null, \Closure $callback = null)
|
|
|
- {
|
|
|
- if ($repository instanceof \Closure) {
|
|
|
- return new Grid(null, $callback);
|
|
|
- }
|
|
|
-
|
|
|
- return new Grid($repository, $callback);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @param $repository
|
|
|
- * @param Closure $callable
|
|
|
- *
|
|
|
- * @return Form
|
|
|
- */
|
|
|
- public static function form($repository, Closure $callable = null)
|
|
|
- {
|
|
|
- return new Form($repository, $callable);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Build a tree.
|
|
|
- *
|
|
|
- * @param $model
|
|
|
- * @param Closure|null $callable
|
|
|
- *
|
|
|
- * @return Tree
|
|
|
- */
|
|
|
- public static function tree($model, Closure $callable = null)
|
|
|
- {
|
|
|
- return new Tree($model, $callable);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Build show page.
|
|
|
- *
|
|
|
- * @example
|
|
|
- * $show = Admin::show();
|
|
|
- *
|
|
|
- * $show = Admin::show(new Repository);
|
|
|
- *
|
|
|
- * $show = Admin::show(new Repository, function (Show $show) {});
|
|
|
- *
|
|
|
- * $show = Admin::show($id, new Repository, function (Show $show) {});
|
|
|
- *
|
|
|
- * @param $repository
|
|
|
- * @param mixed $callable
|
|
|
- *
|
|
|
- * @return Show
|
|
|
- */
|
|
|
- public static function show($id = null, $repository = null, \Closure $callable = null)
|
|
|
- {
|
|
|
- switch (func_num_args()) {
|
|
|
- case 0:
|
|
|
- $show = new Show();
|
|
|
-
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- $show = new Show($id);
|
|
|
-
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- $show = new Show($id, $repository);
|
|
|
-
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- $show = new Show($repository, $callable);
|
|
|
-
|
|
|
- $show->key($id);
|
|
|
- }
|
|
|
-
|
|
|
- return $show;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* @param Closure $callable
|
|
|
*
|