app/Http/Controllers/Admin/InterviewCrudController.php
/**
     * Show the form for creating inserting a new row.
     *
     * @return Response
     */
Show the form for creating inserting a new row.
@return Response
Show the form for creating inserting a new row . @return Response
public function create()
    {
        $this->crud->hasAccessOrFail('create');
        $this->data['crud'] = $this->crud;
        $this->data['saveAction'] = $this->getSaveAction();
        $this->data['fields'] = $this->crud->getCreateFields();
        $this->data['title'] = trans('backpack::crud.add') . ' ' . $this->crud->entity_name;
        if ($this->crud->request->customer_id) {
            $customer = Customer::findOrFail($this->crud->request->customer_id);
            $this->data['title'] = $customer->fullname . ' adlı müşteriye görüşme ekle';
            $this->data['entry'] = $customer;
            $this->crud->removeField('customer_id');
            $this->crud->addField([
                'name' => 'customer_id',
                'label' => "Müşteri",
                'type' => 'disabled_relation_text',
                'attribute' => 'fullname',
                'model' => $customer
            ]);
            return view("crud::create_interview_for_customer", $this->data);
        }
        return view($this->crud->getCreateView(), $this->data);
    }
public function create ( ) { $ this -> crud -> hasAccessOrFail ( 'create' ) ; $ this -> data [ 'crud' ] = $ this -> crud ; $ this -> data [ 'saveAction' ] = $ this -> getSaveAction ( ) ; $ this -> data [ 'fields' ] = $ this -> crud -> getCreateFields ( ) ; $ this -> data [ 'title' ] = trans ( 'backpack::crud.add' ) . ' ' . $ this -> crud -> entity_name ; if ( $ this -> crud -> request -> customer_id ) { $ customer = Customer :: findOrFail ( $ this -> crud -> request -> customer_id ) ; $ this -> data [ 'title' ] = $ customer -> fullname . ' adlı müşteriye görüşme ekle'; $ this -> data [ 'entry' ] = $ customer ; $ this -> crud -> removeField ( 'customer_id' ) ; $ this -> crud -> addField ( [ 'name' => 'customer_id' , 'label' => " Müşteri", 'type' => 'disabled_relation_text' , 'attribute' => 'fullname' , 'model' => $ customer ] ) ; return view ( " crud::create_interview_for_customer " , $ this -> data ) ; } return view ( $ this -> crud -> getCreateView ( ) , $ this -> data ) ; }
Show the form for creating inserting a new row.
Show the form for creating inserting a new row .
// prepare the fields you need to show // load the view from /resources/views/vendor/backpack/crud/ if it exists, otherwise load the one in the package