- changed limits for item list (#171)
* - changed limits for displayed items * - transferred to models * - updated tests
This commit is contained in:
parent
9147b859d3
commit
995c0b6696
@ -31,6 +31,7 @@ class Resume extends Model
|
|||||||
"technologies" => AsCollection::class,
|
"technologies" => AsCollection::class,
|
||||||
"projects" => AsCollection::class,
|
"projects" => AsCollection::class,
|
||||||
];
|
];
|
||||||
|
protected $perPage = 50;
|
||||||
|
|
||||||
public function user(): BelongsTo
|
public function user(): BelongsTo
|
||||||
{
|
{
|
||||||
|
@ -46,6 +46,7 @@ class User extends Authenticatable implements NotifiableInterface
|
|||||||
protected $with = [
|
protected $with = [
|
||||||
"profile",
|
"profile",
|
||||||
];
|
];
|
||||||
|
protected $perPage = 50;
|
||||||
|
|
||||||
public function profile(): HasOne
|
public function profile(): HasOne
|
||||||
{
|
{
|
||||||
|
@ -49,6 +49,7 @@ class VacationRequest extends Model
|
|||||||
"to" => "date",
|
"to" => "date",
|
||||||
"event_ids" => AsCollection::class,
|
"event_ids" => AsCollection::class,
|
||||||
];
|
];
|
||||||
|
protected $perPage = 50;
|
||||||
|
|
||||||
public function user(): BelongsTo
|
public function user(): BelongsTo
|
||||||
{
|
{
|
||||||
|
@ -73,10 +73,10 @@ class UserTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testUserListIsPaginated(): void
|
public function testUserListIsPaginated(): void
|
||||||
{
|
{
|
||||||
User::factory()->count(15)->create();
|
User::factory()->count(50)->create();
|
||||||
$admin = User::factory()->admin()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
|
|
||||||
$this->assertDatabaseCount("users", 16);
|
$this->assertDatabaseCount("users", 51);
|
||||||
|
|
||||||
$this->actingAs($admin)
|
$this->actingAs($admin)
|
||||||
->get("/users?page=2")
|
->get("/users?page=2")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user