episode->name; } protected function content(Content $content, $episodeId = 1) { $this->episode = Episode::find($episodeId); return $content ->translation($this->translation()) ->breadcrumb( ['text' => $this->episode->name], ['text' => '剧集上传'], ) ->title($this->title()) ->description('剧集上传'); } public function index(Content $content,$episodeId = 0) { return $this->content($content,$episodeId) ->body($this->grid()); } public function create(Content $content,$episodeId = 0) { return $this->content($content,$episodeId) ->body($this->form()); } public function store($episodeId = 0) { $this->episode = Episode::find($episodeId); return $this->form()->store(); } public function edit($id, Content $content, $episodeId = 0) { return $this->content($content,$episodeId) ->body($this->form()->edit($id)); } /** * Make a grid builder. * * @return Grid */ protected function grid() { return Grid::make(EpisodesList::with(['episode'])->where('episodes_id', $this->episode->id), function (Grid $grid) { $grid->column('id')->sortable(); $grid->column('episode.name','剧集名称'); $grid->column('sort')->display(function (){ return '第'.$this->sort.'集'; })->editable(); $grid->column('is_free') ->using(config('global.episode_free')) ->label(['success', 'primary'])->sortable(); $grid->column('sale_price')->editable(); $grid->column('url')->display(function (){ return '