mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Construyendo el formulario de edicion
This commit is contained in:
@ -14,7 +14,7 @@ class CatalogoLibros extends BaseResourceController
|
||||
protected $format = 'json';
|
||||
|
||||
protected static $singularObjectName = 'Catalogo';
|
||||
protected static $singularObjectNameCc = 'catalogo';
|
||||
protected static $singularObjectNameCc = 'CatalogoLibros';
|
||||
protected static $pluralObjectName = 'Catalogos';
|
||||
protected static $pluralObjectNameCc = 'catalogos';
|
||||
|
||||
@ -194,6 +194,17 @@ class CatalogoLibros extends BaseResourceController
|
||||
$q = $this->model->getDatatableQuery();
|
||||
|
||||
$result = DataTable::of($q)
|
||||
->edit(
|
||||
"portada",
|
||||
function ($row, $meta) {
|
||||
if (is_null($row->cubierta_archivo)) {
|
||||
return '<img class="img-thumbnail" src="' . $row->portada . '" alt="Portada" style="max-height: 80px;">';
|
||||
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
)
|
||||
->add("actionBtns", callback: function ($q) {
|
||||
$actions = '';
|
||||
if (auth()->user()->can('catalogo.edit')) {
|
||||
|
||||
Reference in New Issue
Block a user