PHP code example of softlogic-gt / eloquentcrud

1. Go to this page and download the library: Download softlogic-gt/eloquentcrud library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

softlogic-gt / eloquentcrud example snippets


class TestController extends EloquentCrudController
{
    public function setup(Request $request)
    {
        $query = Authusuario::query()
            ->select(
                'usuarioid', 'nombre', 'email', 'telefono', 'direccion', 'activo',
                'fraude', 'cliente_seguro', 'es_empleado'
            );
        $this->setQuery($query);
        $this->setExtraButton([
            'title'  => 'Ordenes',
            'url'    => '/ordenes/ordenes?u={id}&listar=on',
            'icon'   => 'fa fa-shopping-cart',
            'target' => '_blank',
        ]);
        $this->setPermissions(Cancerbero::tienePermisosCrud('admin.usuarios'));
    }
}