- changed limits for item list (#171)

* - changed limits for displayed items

* - transferred to models

* - updated tests
This commit is contained in:
Kamil Niemczycki 2022-06-15 10:14:58 +02:00 committed by GitHub
parent 9147b859d3
commit 995c0b6696
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 2 deletions

View File

@ -31,6 +31,7 @@ class Resume extends Model
"technologies" => AsCollection::class,
"projects" => AsCollection::class,
];
protected $perPage = 50;
public function user(): BelongsTo
{

View File

@ -46,6 +46,7 @@ class User extends Authenticatable implements NotifiableInterface
protected $with = [
"profile",
];
protected $perPage = 50;
public function profile(): HasOne
{

View File

@ -49,6 +49,7 @@ class VacationRequest extends Model
"to" => "date",
"event_ids" => AsCollection::class,
];
protected $perPage = 50;
public function user(): BelongsTo
{

View File

@ -73,10 +73,10 @@ class UserTest extends FeatureTestCase
public function testUserListIsPaginated(): void
{
User::factory()->count(15)->create();
User::factory()->count(50)->create();
$admin = User::factory()->admin()->create();
$this->assertDatabaseCount("users", 16);
$this->assertDatabaseCount("users", 51);
$this->actingAs($admin)
->get("/users?page=2")