InterAdmin ORM. Before version 3.2 it was a part of jp7internet/classes.
The API is heavily inspired by Laravel Eloquent, most methods and arguments are exactly the same.
- Extending Record and Type
- Query
- External:
$usedCeltas = Carro::where('modelo', 'Celta')
->where('ano', '<', date('Y'))
->orderBy('ano', 'desc')
->orderBy('preco') // newer and cheaper first
->take(20) // page with 20 itens
->get(); // get all cars, first() would only bring the first carJust like Laravel Eloquent, the create($array) and fill($array) methods can only receive attributes listed on getFillable() - whitelisted attributes.
- getFillable() - by default returns the fields checked as 'form' on InterAdmin.
You can temporarily disable mass assignment protection when data is safe, on seeds or tests, for example:
\Jp7\Interadmin\Record::unguard();
Classe::create(['idade' => 12, 'nome' => 'teste']);
\Jp7\Interadmin\Record::reguard();- https://wiki.jp7.com.br:81/jp7/index.php?title=ORM&oldid=4164
- https://wiki.jp7.com.br:81/jp7/index.php?title=ORM:Query&oldid=4274
cp .env.example .env.testing
php vendor/bin/codecept run --coverage