Skeleton is ready
This commit is contained in:
22
app/Shared/Service/User/SearchById.php
Normal file
22
app/Shared/Service/User/SearchById.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Shared\Service\User;
|
||||
|
||||
use App\Models\User\User;
|
||||
|
||||
class SearchById implements SearchByIdContract
|
||||
{
|
||||
/**
|
||||
* @param string $id
|
||||
*
|
||||
* @return \App\Models\User\User
|
||||
*
|
||||
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
|
||||
*/
|
||||
public function getById(string $id): User
|
||||
{
|
||||
return User::findOrFail($id);
|
||||
}
|
||||
}
|
||||
12
app/Shared/Service/User/SearchByIdContract.php
Normal file
12
app/Shared/Service/User/SearchByIdContract.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Shared\Service\User;
|
||||
|
||||
use App\Models\User\User;
|
||||
|
||||
interface SearchByIdContract
|
||||
{
|
||||
public function getById(string $id): User;
|
||||
}
|
||||
Reference in New Issue
Block a user