1. Go to this page and download the library: Download dakataa/crud 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/ */
dakataa / crud example snippets
namespace App\Controller;
use App\Entity\Product;
use App\Form\ProductType;
use Dakataa\Crud\Attribute\Entity;
use Dakataa\Crud\Attribute\EntityType;
use Dakataa\Crud\Controller\AbstractCrudController;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\HttpFoundation\Request;use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
#[Route('/product')]
#[Entity(Product::class)]
#[EntityType(ProductType::class)]
class ProductController extends AbstractCrudController
{
}
public function buildCustomQuery(Request $request, QueryBuilder $query): AbstractCrudController
{
$query
->andWhere('a.enabled = true');
return $this;
}