koel/app/Repositories/UserRepository.php

19 lines
375 B
PHP
Raw Normal View History

2018-08-29 06:15:11 +00:00
<?php
namespace App\Repositories;
use App\Models\User;
2022-07-29 06:47:10 +00:00
class UserRepository extends Repository
2018-08-29 06:15:11 +00:00
{
public function getDefaultAdminUser(): User
{
return User::query()->where('is_admin', true)->oldest()->firstOrFail();
}
public function findOneByEmail(string $email): ?User
{
return User::query()->where('email', $email)->first();
}
2018-08-29 06:15:11 +00:00
}