mirror of
https://github.com/kevin-DL/commander_league_api.git
synced 2026-01-13 03:05:32 +00:00
- Save the profile into the current request when the user is authenticated - Created the migration for the profiles table - Created the Profile model - Created route to retrieve the current user's profile
20 lines
421 B
PHP
20 lines
421 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
class ProfilesController extends Controller
|
|
{
|
|
public function current(Request $request)
|
|
{
|
|
$params = $request->query();
|
|
$user = $params['user'];
|
|
return response()->json([
|
|
'id' => $user['id'],
|
|
'display_name' => $user['display_name'],
|
|
'picture' => $user['picture'],
|
|
]);
|
|
}
|
|
}
|