Crud: access to all model attributes in button

Created on 1 Feb 2017  路  5Comments  路  Source: Laravel-Backpack/CRUD

Hi
Is there anyway to access all model attributes in button view . yet we just access to columns that show in data table view .

Most helpful comment

From https://laravel-backpack.readme.io/docs/crud-buttons

The most useful variables you'll have in this file here are:

  • $entry - the database entry you're showing (only inside the line stack);
  • $crud

You can use $crud->getEntries();

All 5 comments

From https://laravel-backpack.readme.io/docs/crud-buttons

The most useful variables you'll have in this file here are:

  • $entry - the database entry you're showing (only inside the line stack);
  • $crud

You can use $crud->getEntries();

I have almost the same issue. I want to access some model attributes in a custom column view.
But i only have access to attributes declared with addColumn in the controller.
I not, they are they are not in $crud->getEntries();

I found that if ajax table view is enabled , $entry just return database column we are showing in data table view not all model attributes .

the problem is in this line :
https://github.com/Laravel-Backpack/CRUD/blob/master/src/app/Http/Controllers/CrudFeatures/AjaxTable.php#L16

Yes enableAjaxTable changes a lot of things...
Also model_function and accessors are not working with enableAjaxTable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

voidstate picture voidstate  路  3Comments

alexgmin picture alexgmin  路  3Comments

lotarbo picture lotarbo  路  3Comments

sonoftheweb picture sonoftheweb  路  3Comments

jorgepires picture jorgepires  路  3Comments