Bagosep

api.php

Jun 15th, 2021
654
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. use Illuminate\Http\Request;
  4.  
  5. /*
  6. |--------------------------------------------------------------------------
  7. | API Routes
  8. |--------------------------------------------------------------------------
  9. |
  10. | Here is where you can register API routes for your application. These
  11. | routes are loaded by the RouteServiceProvider within a group which
  12. | is assigned the "api" middleware group. Enjoy building your API!
  13. |
  14. */
  15.  
  16. Route::middleware('auth:api')->get('/user', function (Request $request) {
  17.     return $request->user();
  18. });
  19.  
  20. Route::post('login-praktikan', 'LoginController@loginPraktikanApi');
  21. Route::post('login-admin', 'LoginController@loginAdminApi');
  22. Route::post('periode-praktikum', 'AdminController@getPraktikumPeriodeApi');
  23.  
  24. Route::post('login', 'api\LoginController@login');
  25.  
  26. Route::group(['middleware' => ['assign.guard:aslab','jwt.auth'],'prefix' => 'aslab'],function(){
  27.     Route::post('profile', 'api\AslabController@profile')->name('profile');
  28. });
  29.  
  30. Route::group(['middleware' => ['assign.guard:dosen','jwt.auth'],'prefix' => 'dosen'],function(){
  31.     Route::get('profile', 'api\DosenController@profile')->name('profile');
  32.     Route::get('get_praktikum', 'api\DosenController@get_praktikum')->name('get_praktikum');
  33.     Route::post('get_praktikan', 'api\DosenController@get_praktikan')->name('get_praktikan');
  34.     Route::post('store_nilai', 'api\DosenController@store_nilai')->name('store_nilai');
  35. });
  36.  
RAW Paste Data