feat: add app and database modules

This commit is contained in:
2026-05-21 16:05:11 +07:00
parent 37b7e783f5
commit fad70d096b
212 changed files with 23901 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
namespace App\Repositories;
use App\Models\User;
use Illuminate\Database\Eloquent\Collection;
class UserRepository extends BaseRepository
{
public function __construct(User $model)
{
parent::__construct($model);
}
/**
* Get users by role.
*
* @return Collection
*/
public function getByRole(string $role)
{
return $this->model->role($role)->get();
}
/**
* Search users by name or email.
*
* @return Collection
*/
public function search(string $query)
{
return $this->model->where('name', 'like', "%{$query}%")
->orWhere('email', 'like', "%{$query}%")
->get();
}
}