grid = $grid; } protected function renderQuickCreateButton() { if (! $this->grid->option('show_quick_create_btn')) { return; } $new = trans('admin.new'); $url = $this->grid->createUrl(); [$width, $height] = $this->grid->option('dialog_form_area'); Form::modal($new) ->click(".{$this->grid->rowName()}-create") ->success('LA.reload()') ->dimensions($width, $height) ->render(); $text = $this->grid->option('show_create_btn') ? '' : ""; return "$text"; } protected function renderCreateButton() { if (! $this->grid->option('show_create_btn')) { return; } $new = trans('admin.new'); $url = $this->grid->createUrl(); return " "; } public function render() { if (! $this->grid->option('show_create_btn') && ! $this->grid->option('show_quick_create_btn')) { return; } return "
{$this->renderCreateButton()}{$this->renderQuickCreateButton()}
"; } }