Skip to content

Commit

Permalink
Build: initial controllers have been created for the basic operation …
Browse files Browse the repository at this point in the history
…of the framework
  • Loading branch information
Sleon4 committed Jun 2, 2022
1 parent 3199047 commit 2690004
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 11 deletions.
22 changes: 22 additions & 0 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use LionRequest\Response;

class LoginController extends Controller {

public function __construct() {
$this->init();
}

public function auth() {
return Response::success('signin...');
}

public function logout() {
return Response::success('logout...');
}

}
18 changes: 18 additions & 0 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use LionRequest\Response;

class RegisterController extends Controller {

public function __construct() {
$this->init();
}

public function register() {
return Response::success('signout...');
}

}
15 changes: 4 additions & 11 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Carbon\Carbon;

use App\Http\Middleware\JWT\AuthorizationMiddleware;
use App\Http\Controllers\Auth\{ LoginController, RegisterController };

/**
* ------------------------------------------------------------------------------
Expand All @@ -23,15 +24,7 @@
});

Route::prefix('auth', function() {
Route::post('signin', function() {
return Response::success('signin...');
}, ['no-auth']);

Route::post('signout', function() {
return Response::success('signout...');
}, ['no-auth']);

Route::get('logout', function() {
return Response::success('logout...');
}, ['auth']);
Route::get('signin', [LoginController::class, 'auth'], ['no-auth']);
Route::get('logout', [LoginController::class, 'logout'], ['auth']);
Route::get('signout', [RegisterController::class, 'register'], ['no-auth']);
});

0 comments on commit 2690004

Please sign in to comment.