mirror of
https://github.com/kevin-DL/commander_league_api.git
synced 2026-01-12 02:45:19 +00:00
Profile
- 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
This commit is contained in:
19
app/Http/Controllers/ProfilesController.php
Normal file
19
app/Http/Controllers/ProfilesController.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user