Created
July 22, 2021 04:17
-
-
Save EricMcWinNer/7773d90bfb52c735ffd5c757a5ccc557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\Employer\Dashboard; | |
use App\Http\Controllers\Controller; | |
use App\Models\User; | |
class HomeController extends Controller | |
{ | |
public function getUser($id) { | |
$user = User::find($id); | |
// Mutations would happen automatically | |
return response(['data' => $user], 200); | |
} | |
public function getUsers() { | |
$users = User::all(); | |
return response(['data' => $users], 200); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment