fadlyshafa

Untitled

Aug 2nd, 2021
636
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. use Illuminate\Http\Request;
  4. use Illuminate\Support\Facades\Route;
  5.  
  6. use App\Htpp\Controllers\Api_controller;
  7.  
  8. /*
  9. |--------------------------------------------------------------------------
  10. | API Routes
  11. |--------------------------------------------------------------------------
  12. |
  13. | Here is where you can register API routes for your application. These
  14. | routes are loaded by the RouteServiceProvider within a group which
  15. | is assigned the "api" middleware group. Enjoy building your API!
  16. |
  17. */
  18.  
  19. Route::middleware('auth:api')->get('/user', function (Request $request) {
  20.     return $request->user();
  21. });
  22.  
  23. Route::get('/test',function(){
  24.     return response()->json([
  25.         'success'=>true,
  26.         'message'=>'ok'
  27.     ]);
  28. });
  29.  
  30. Route::get('get-tests',[Api_controller::class,'index']);
RAW Paste Data