PHP Classes

File: routes/api.php

Recommend this page to a friend!
  Classes of Ahmed Saad   PHP Student Sessions API   routes/api.php   Download  
File: routes/api.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Student Sessions API
Calculate sessions for students to finish chapters
Author: By
Last change:
Date: 2 years ago
Size: 808 bytes
 

Contents

Class file image Download
<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::get( '/', function(){
    return
response()->json( [ 'message' => 'apis are prefixed by /v1/' ] );
} );


Route::group( [ 'prefix' => 'v1', 'as' => '.v1' ], function(){

   
Route::get( '/', function(){
        return
response()->json( [
           
'message' => 'send post request to /v1/sessions'
       
] );
    } );

   
Route::post( '/sessions', 'StudentController@getSessions' )->name( 'sessions' );

} );