Documentacion de la api en el readme
This commit is contained in:
@@ -6,8 +6,8 @@ use App\Services\Auth0Service;
|
||||
use App\Traits\UuidPrimaryKey;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use phpDocumentor\Reflection\Types\Boolean;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class Usuario
|
||||
@@ -40,9 +40,14 @@ class Usuario extends Model {
|
||||
*/
|
||||
public static function findByIdOrAuth0Id($id) {
|
||||
if (str_starts_with($id, 'auth0')) {
|
||||
return Usuario::where('auth0_id', urldecode($id))->first();
|
||||
return Usuario::where('auth0_id', urldecode($id))->with('restaurantes')->first();
|
||||
} else {
|
||||
return Usuario::where('id', $id)->first();
|
||||
try {
|
||||
return Usuario::where('id', $id)->with('restaurantes')->first();
|
||||
} catch (QueryException $ex) {
|
||||
Log::warning('Se intento obtener un usuario con un id invalido', ['id' => $id]);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user