Vaharsolta

Untitled

Feb 27th, 2021
983
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace App\Orchid\Screens\Clear;
  4.  
  5. use App\Models\Clear\ClearSample;
  6. use App\Orchid\Layouts\Clear\ClearSampleShowLayout;
  7. use Orchid\Screen\Screen;
  8.  
  9. class ClearSampleShowScreen extends Screen
  10. {
  11.     public $name = 'Clear Sample';
  12.     public $description = 'View Clear Sample';
  13.  
  14.     public function query(ClearSample $clearSample): array
  15.     {
  16.         $clearSample->load(['publishers', 'labels', 'writers']);
  17.  
  18.         return [
  19.             'clear_sample' => $clearSample //Получаю ошибку Call to a member function getContent() on bool но если оберну в [$clearSample] то один объект приходит как массив но ошибку не получаю
  20.         ];
  21.     }
  22.  
  23.     public function commandBar(): array
  24.     {
  25.         return [];
  26.     }
  27.  
  28.     public function layout(): array
  29.     {
  30.         return [
  31.             ClearSampleShowLayout::class
  32.         ];
  33.     }
  34. }
  35. ?>
  36.  
  37. <?php
  38.  
  39. namespace App\Orchid\Layouts\Clear;
  40.  
  41. use Orchid\Screen\Layouts\Table;
  42. use Orchid\Screen\TD;
  43.  
  44. class ClearSampleShowLayout extends Table
  45. {
  46.     protected $target = 'clear_sample';
  47.  
  48.     protected function columns(): array
  49.     {
  50.         return [
  51.             TD::set('artist_name', __('Name')) //Получаю ошибку Call to a member function getContent() on bool
  52.         ];
  53.     }
  54. }
  55. ?>
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×