-
Notifications
You must be signed in to change notification settings - Fork 1
Debugable
Gilberto Junior edited this page Dec 5, 2019
·
5 revisions
Avaliable for classes that extends CodeHappy\DataLayer\Repository
.
Add the trait CodeHappy\DataLayer\Traits\Debugable
into the repository:
<?php
namespace App\Repositories;
use CodeHappy\DataLayer\Repository;
use CodeHappy\DataLayer\Traits\Debugable;
class UserRepository extends Repository
{
use Debugable;
}
To debugs your queries.
public function toSql(): string;
PHP's way:
$productRepository->newQuery()
->isEqualTo('category_id', 123)
->orIsEqualTo('brand_id', 456)
->toSql();
Output:
"SELECT * FROM "products" WHERE category_id = '123' OR brand_id = '456';"
by c0dehappy