PHP code example of devgeek / beacon-admin
1. Go to this page and download the library: Download devgeek/beacon-admin 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/ */
devgeek / beacon-admin example snippets
declare(strict_types=1);
namespace App\Controller\Admin;
use App\Entity\Product;
use Devgeek\BeaconAdmin\Controller\AbstractCrudController;
use Devgeek\BeaconAdmin\Crud\CrudConfig;
final class ProductCrudController extends AbstractCrudController
{
protected function getEntityClass(): string
{
return Product::class;
}
protected function configureCrud(CrudConfig $config): void
{
$config
->fields(['name', 'price', 'category', 'createdAt'])
->sortableFields(['name', 'price', 'createdAt'])
->searchableFields(['name'])
->pageSize(25);
}
}