Hydra Controller

pull/3/head
Hasin Hayder 3 years ago
parent b8b145c96b
commit 711d2f7fa3

@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HydraController extends Controller
{
public function hydra(){
return response([
"message"=>"Welcome to Hydra, the zero config API boilerplate with roles and abilities for Laravel Sanctum. Please visit https://hasinhayder.github.io/hydra to know more."
]);
}
public function version(){
return response([
"message"=>"1.0.0"
]);
}
}

@ -1,5 +1,6 @@
<?php <?php
use App\Http\Controllers\HydraController;
use App\Http\Controllers\RoleController; use App\Http\Controllers\RoleController;
use App\Http\Controllers\UserController; use App\Http\Controllers\UserController;
use App\Http\Controllers\UserRoleController; use App\Http\Controllers\UserRoleController;
@ -21,6 +22,9 @@ Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user(); return $request->user();
}); });
Route::get('/hydra',[HydraController::class,'hydra']);
Route::get('/hydra/version',[HydraController::class,'version']);
Route::apiResource('users',UserController::class)->except(['edit','create'])->middleware(['auth:sanctum', 'abilities:admin,super-admin']); Route::apiResource('users',UserController::class)->except(['edit','create'])->middleware(['auth:sanctum', 'abilities:admin,super-admin']);
Route::post('users',[UserController::class,'store']); Route::post('users',[UserController::class,'store']);
Route::post('login',[UserController::class,'login']); Route::post('login',[UserController::class,'login']);

Loading…
Cancel
Save