Skip to content

Instantly share code, notes, and snippets.

@EricMcWinNer
Created July 22, 2021 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EricMcWinNer/7773d90bfb52c735ffd5c757a5ccc557 to your computer and use it in GitHub Desktop.
Save EricMcWinNer/7773d90bfb52c735ffd5c757a5ccc557 to your computer and use it in GitHub Desktop.
<?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