1 | <?php |
||
18 | class Admin |
||
19 | { |
||
20 | use HasAssets; |
||
21 | |||
22 | /** |
||
23 | * The Laravel admin version. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | const VERSION = '1.6.0'; |
||
28 | |||
29 | /** |
||
30 | * @var Navbar |
||
31 | */ |
||
32 | protected $navbar; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | public static $extensions = []; |
||
38 | |||
39 | /** |
||
40 | * @var []Closure |
||
41 | */ |
||
42 | public static $booting; |
||
43 | |||
44 | /** |
||
45 | * @var []Closure |
||
46 | */ |
||
47 | public static $booted; |
||
48 | |||
49 | /** |
||
50 | * Returns the long version of Laravel-admin. |
||
51 | * |
||
52 | * @return string The long application version |
||
53 | */ |
||
54 | public static function getLongVersion() |
||
55 | { |
||
56 | return sprintf('Laravel-admin <comment>version</comment> <info>%s</info>', self::VERSION); |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @param $model |
||
61 | * @param Closure $callable |
||
62 | * |
||
63 | * @return \Encore\Admin\Grid |
||
64 | * |
||
65 | * @deprecated since v1.6.1 |
||
66 | */ |
||
67 | public function grid($model, Closure $callable) |
||
68 | { |
||
69 | return new Grid($this->getModel($model), $callable); |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * @param $model |
||
74 | * @param Closure $callable |
||
75 | * |
||
76 | * @return \Encore\Admin\Form |
||
77 | * |
||
78 | * @deprecated since v1.6.1 |
||
79 | */ |
||
80 | public function form($model, Closure $callable) |
||
84 | |||
85 | /** |
||
86 | * Build a tree. |
||
87 | * |
||
88 | * @param $model |
||
89 | * |
||
90 | * @return \Encore\Admin\Tree |
||
91 | */ |
||
92 | public function tree($model, Closure $callable = null) |
||
96 | |||
97 | /** |
||
98 | * Build show page. |
||
99 | * |
||
100 | * @param $model |
||
101 | * @param mixed $callable |
||
102 | * |
||
103 | * @return Show |
||
104 | * |
||
105 | * @deprecated since v1.6.1 |
||
106 | */ |
||
107 | public function show($model, $callable = null) |
||
111 | |||
112 | /** |
||
113 | * @param Closure $callable |
||
114 | * |
||
115 | * @return \Encore\Admin\Layout\Content |
||
116 | * |
||
117 | * @deprecated since v1.6.1 |
||
118 | */ |
||
119 | public function content(Closure $callable = null) |
||
123 | |||
124 | /** |
||
125 | * @param $model |
||
126 | * |
||
127 | * @return mixed |
||
128 | */ |
||
129 | public function getModel($model) |
||
141 | |||
142 | /** |
||
143 | * Left sider-bar menu. |
||
144 | * |
||
145 | * @return array |
||
146 | */ |
||
147 | public function menu() |
||
151 | |||
152 | /** |
||
153 | * Get admin title. |
||
154 | * |
||
155 | * @return Config |
||
156 | */ |
||
157 | public function title() |
||
161 | |||
162 | /** |
||
163 | * Get current login user. |
||
164 | * |
||
165 | * @return mixed |
||
166 | */ |
||
167 | public function user() |
||
171 | |||
172 | /** |
||
173 | * Set navbar. |
||
174 | * |
||
175 | * @param Closure|null $builder |
||
176 | * |
||
177 | * @return Navbar |
||
178 | */ |
||
179 | public function navbar(Closure $builder = null) |
||
187 | |||
188 | /** |
||
189 | * Get navbar object. |
||
190 | * |
||
191 | * @return \Encore\Admin\Widgets\Navbar |
||
192 | */ |
||
193 | public function getNavbar() |
||
201 | |||
202 | /** |
||
203 | * Register the auth routes. |
||
204 | * |
||
205 | * @return void |
||
206 | */ |
||
207 | public function registerAuthRoutes() |
||
235 | |||
236 | /** |
||
237 | * Extend a extension. |
||
238 | * |
||
239 | * @param string $name |
||
240 | * @param string $class |
||
241 | * |
||
242 | * @return void |
||
243 | */ |
||
244 | public static function extend($name, $class) |
||
248 | |||
249 | /** |
||
250 | * @param callable $callback |
||
251 | */ |
||
252 | public static function booting(callable $callback) |
||
256 | |||
257 | /** |
||
258 | * @param callable $callback |
||
259 | */ |
||
260 | public static function booted(callable $callback) |
||
264 | |||
265 | /* |
||
266 | * Disable Pjax for current Request |
||
267 | * |
||
268 | * @return void |
||
269 | */ |
||
270 | public function disablePjax() |
||
276 | } |
||
277 |