Advertisement
Vaharsolta

Untitled

Feb 27th, 2021
1,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.33 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement