Search code examples
laravel-5.3laravel-backpack

How to go directly in the edit section in Backpack-Laravel?


I need that when you to click on an item in the Backpack sidebar (For ex. Profile), I immediately can edit the information in this page (For ex. the user who is writing, then the name, surname, date of birth etc.) without going through the table, typical visual of backpack.

In a simple manner: The user should have the ability to change their profile information whith one click.

How can I do this in Backpack-laravel? Anyone have any ideas?

Starting code: ProfileCrudController.php

public function __construct()
{
    parent::__construct();
}

public function edit($id)
{
    return parent::edit($id);
}

Solution

  • I do not know if it might be the correct way. But it's the only way I've found to accomplish what I had in mind.

      public function index()
      {
        $this->crud->addFields([
            [
                'name' => 'name',
                'label' => 'Name',
                'type' => 'Text'
            ],
            [
                'name' => 'surname',
                'label' => 'Surname',
                'type' => 'Text'
            ]
        ]);
        return parent::edit(Auth::id());
    }