| @@ 364-385 (lines=22) @@ | ||
| 361 | * @param array|null $payload |
|
| 362 | * @return DisplayInterface|mixed |
|
| 363 | */ |
|
| 364 | public function fireDisplay(array $payload = []) |
|
| 365 | { |
|
| 366 | if (! is_callable($this->getDisplay())) { |
|
| 367 | return; |
|
| 368 | } |
|
| 369 | ||
| 370 | $display = $this->app->call($this->getDisplay(), $payload); |
|
| 371 | ||
| 372 | if ($display instanceof DisplayDatatablesAsync) { |
|
| 373 | $display->setPayload($payload); |
|
| 374 | } |
|
| 375 | ||
| 376 | if ($display instanceof DisplayInterface) { |
|
| 377 | $display->setModelClass($this->getClass()); |
|
| 378 | } |
|
| 379 | ||
| 380 | if ($display instanceof Initializable) { |
|
| 381 | $display->initialize(); |
|
| 382 | } |
|
| 383 | ||
| 384 | return $display; |
|
| 385 | } |
|
| 386 | ||
| 387 | /** |
|
| 388 | * @return Closure|null |
|
| @@ 410-430 (lines=21) @@ | ||
| 407 | /** |
|
| 408 | * @return mixed|void |
|
| 409 | */ |
|
| 410 | public function fireCreate() |
|
| 411 | { |
|
| 412 | if (! is_callable($this->getCreate())) { |
|
| 413 | return; |
|
| 414 | } |
|
| 415 | ||
| 416 | $form = $this->app->call($this->getCreate()); |
|
| 417 | if ($form instanceof DisplayInterface) { |
|
| 418 | $form->setModelClass($this->getClass()); |
|
| 419 | } |
|
| 420 | ||
| 421 | if ($form instanceof FormInterface) { |
|
| 422 | $form->setAction($this->getStoreUrl()); |
|
| 423 | } |
|
| 424 | ||
| 425 | if ($form instanceof Initializable) { |
|
| 426 | $form->initialize(); |
|
| 427 | } |
|
| 428 | ||
| 429 | return $form; |
|
| 430 | } |
|
| 431 | ||
| 432 | /** |
|
| 433 | * @return Closure|null |
|