Initial commit
This commit is contained in:
60
routes/api.php
Normal file
60
routes/api.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\AuthController;
|
||||
use App\Http\Controllers\ApiMerchantsController;
|
||||
use App\Http\Controllers\ApiDealersController;
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
||||
// // dd($request->all());
|
||||
// return $request->user();
|
||||
// });
|
||||
|
||||
|
||||
Route::get('/test', fn() => 'OK');
|
||||
|
||||
Route::post('/login', [AuthController::class, 'login']);
|
||||
// Route::post('/register', [AuthController::class, 'register']);
|
||||
|
||||
Route::middleware('auth:sanctum')->group(function () {
|
||||
Route::get('/user', function (Request $request) {
|
||||
return $request->user();
|
||||
});
|
||||
|
||||
Route::post('merchant/login', [ApiMerchantsController::class, 'merchant_login']);
|
||||
Route::post('merchant/transactions', [ApiMerchantsController::class, 'get_transactions']);
|
||||
Route::post('merchant/customertopup', [ApiMerchantsController::class, 'customerTopupStore']);
|
||||
Route::post('/logout', [AuthController::class, 'logout']); //will not be needed
|
||||
|
||||
Route::get('merchant/dealers', [ApiMerchantsController::class, 'get_dealers']);
|
||||
Route::post('merchant/refund', [ApiMerchantsController::class, 'merchantToDealerRefund']);
|
||||
|
||||
|
||||
Route::post('dealer/login', [ApiDealersController::class, 'handleLogin']);
|
||||
Route::post('dealer/balance', [ApiDealersController::class, 'getBalance']);
|
||||
Route::post('dealer/transactions', [ApiDealersController::class, 'getTransactionsJson']);
|
||||
Route::post('dealer/activities', [ApiDealersController::class, 'getActivity']);
|
||||
Route::post('dealer/topupmerchant', [ApiDealersController::class, 'merchantTopupStore']);
|
||||
|
||||
|
||||
/*
|
||||
Route::get('/change-pin', 'MerchantController@showchangepin');
|
||||
Route::post('change-pin', 'MerchantController@changePin');
|
||||
|
||||
Route::get('activity', 'MerchantController@getActivity');
|
||||
|
||||
|
||||
*/
|
||||
|
||||
});
|
||||
56
routes/auth.php
Normal file
56
routes/auth.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\Auth\AuthenticatedSessionController;
|
||||
use App\Http\Controllers\Auth\ConfirmablePasswordController;
|
||||
use App\Http\Controllers\Auth\EmailVerificationNotificationController;
|
||||
use App\Http\Controllers\Auth\EmailVerificationPromptController;
|
||||
use App\Http\Controllers\Auth\NewPasswordController;
|
||||
use App\Http\Controllers\Auth\PasswordResetLinkController;
|
||||
use App\Http\Controllers\Auth\RegisteredUserController;
|
||||
use App\Http\Controllers\Auth\VerifyEmailController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::middleware('guest')->group(function () {
|
||||
Route::get('register', [RegisteredUserController::class, 'create'])
|
||||
->name('register');
|
||||
|
||||
Route::post('register', [RegisteredUserController::class, 'store']);
|
||||
|
||||
Route::get('login', [AuthenticatedSessionController::class, 'create'])
|
||||
->name('login');
|
||||
|
||||
Route::post('login', [AuthenticatedSessionController::class, 'store']);
|
||||
|
||||
Route::get('forgot-password', [PasswordResetLinkController::class, 'create'])
|
||||
->name('password.request');
|
||||
|
||||
Route::post('forgot-password', [PasswordResetLinkController::class, 'store'])
|
||||
->name('password.email');
|
||||
|
||||
Route::get('reset-password/{token}', [NewPasswordController::class, 'create'])
|
||||
->name('password.reset');
|
||||
|
||||
Route::post('reset-password', [NewPasswordController::class, 'store'])
|
||||
->name('password.update');
|
||||
});
|
||||
|
||||
Route::middleware('auth')->group(function () {
|
||||
Route::get('verify-email', [EmailVerificationPromptController::class, '__invoke'])
|
||||
->name('verification.notice');
|
||||
|
||||
Route::get('verify-email/{id}/{hash}', [VerifyEmailController::class, '__invoke'])
|
||||
->middleware(['signed', 'throttle:6,1'])
|
||||
->name('verification.verify');
|
||||
|
||||
Route::post('email/verification-notification', [EmailVerificationNotificationController::class, 'store'])
|
||||
->middleware('throttle:6,1')
|
||||
->name('verification.send');
|
||||
|
||||
Route::get('confirm-password', [ConfirmablePasswordController::class, 'show'])
|
||||
->name('password.confirm');
|
||||
|
||||
Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']);
|
||||
|
||||
Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])
|
||||
->name('logout');
|
||||
});
|
||||
18
routes/channels.php
Normal file
18
routes/channels.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Broadcast Channels
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may register all of the event broadcasting channels that your
|
||||
| application supports. The given channel authorization callbacks are
|
||||
| used to check if an authenticated user can listen to the channel.
|
||||
|
|
||||
*/
|
||||
|
||||
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
||||
return (int) $user->id === (int) $id;
|
||||
});
|
||||
19
routes/console.php
Normal file
19
routes/console.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Inspiring;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Console Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This file is where you may define all of your Closure based console
|
||||
| commands. Each Closure is bound to a command instance allowing a
|
||||
| simple approach to interacting with each command's IO methods.
|
||||
|
|
||||
*/
|
||||
|
||||
Artisan::command('inspire', function () {
|
||||
$this->comment(Inspiring::quote());
|
||||
})->purpose('Display an inspiring quote');
|
||||
200
routes/web.php
Normal file
200
routes/web.php
Normal file
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
use App\Http\Controllers\ExcelProcessingController;
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
// Route::get('/', function () {
|
||||
// return view('welcome');
|
||||
// });
|
||||
|
||||
// Route::get('excel', 'ExcelProcessingController@inddex');
|
||||
/*
|
||||
Route::get('/dashboard', function () {
|
||||
return view('dashboard');
|
||||
})->middleware(['auth'])->name('dashboard');
|
||||
*/
|
||||
|
||||
//require __DIR__.'/auth.php';
|
||||
|
||||
Route::post('/tokens/create', function (Request $request) {
|
||||
return ['token' => $request->user()->createToken('api-token')->plainTextToken];
|
||||
});
|
||||
|
||||
Route::get('/docs/api', function () {
|
||||
return view('api-docs');
|
||||
});
|
||||
Route::get('graph', 'MerchantController@merchant_transactions_graph');
|
||||
// Route::get('testmattermost', 'UtilityController@mattermosttest');
|
||||
|
||||
|
||||
|
||||
Route::get('testing', function(){
|
||||
$ucm_response = 'here at the wall ' . time();
|
||||
$pop = file_put_contents("/var/www/public/airtime_sales_portal/public/logs/" . date("Y_m_d_") . "sms_responses.txt", $ucm_response . PHP_EOL, FILE_APPEND);
|
||||
dd($pop);
|
||||
});
|
||||
Route::group(['middleware' => ['login']], function () {
|
||||
|
||||
Route::get('/login', 'LoginController@login_page');
|
||||
|
||||
Route::post('login_user','LoginController@login_user');
|
||||
|
||||
Route::get('add_user','LoginController@add_user');
|
||||
|
||||
//Route::get('register', 'LoginController@register_page');
|
||||
|
||||
Route::post('reset-password', 'LoginController@reset_password');
|
||||
|
||||
Route::get('forgot-password', 'LoginController@forgot_page');
|
||||
|
||||
Route::post('send-reset-mail', 'LoginController@sendResetMail');
|
||||
|
||||
Route::get('confirm-mail', 'LoginController@confirmMail');
|
||||
|
||||
});
|
||||
|
||||
|
||||
Route::get('/logout', 'LoginController@logout')->middleware('logout');
|
||||
|
||||
|
||||
/**
|
||||
* Admin Route
|
||||
*/
|
||||
|
||||
Route::get('/', 'LandingPageController@index');
|
||||
|
||||
Route::get('admin', 'DashboardController@index')->middleware('admin');
|
||||
Route::get('dealer', 'OrganisationsController@landing')->middleware('organisation');
|
||||
|
||||
Route::group(['middleware' => ['admin'], 'prefix' => 'admin'], function () {
|
||||
Route::get('/', 'DashboardController@index')->name('login');
|
||||
Route::get('organisations/create', 'AdminController@createOrg');
|
||||
Route::get('organisations', 'AdminController@index');
|
||||
Route::get('merchants', 'AdminController@merchant_index');
|
||||
Route::post('organisation/store', 'AdminController@organisationStore');
|
||||
Route::put('organisation/update/{id}', 'AdminController@update')->name('admin.organisation.update');
|
||||
Route::put('merchants/update/{id}', 'AdminController@merchant_update')->name('admin.merchant.update');
|
||||
Route::post('organisation/userupdate', 'AdminController@userupdate')->name('admin.organisation.userupdate');
|
||||
Route::get('organisation/edit/{id}', 'AdminController@edit')->name('organisation.edit');
|
||||
Route::get('organisation/show/{id}', 'AdminController@show')->name('organisation.show');
|
||||
|
||||
Route::get('merchants/edit/{id}', 'AdminController@merchant_edit')->name('organisation.edit');
|
||||
|
||||
Route::get('organisation/useredit/{id}', 'AdminController@useredit')->name('organisation.useredit');
|
||||
// Route::get('organisation/delete/{id}', 'AdminController@destroy')->name('organisation.delete');
|
||||
// Route::get('organisations/enable/{id}', 'AdminController@enable');
|
||||
// Route::get('organisations/disable/{id}', 'AdminController@disable');
|
||||
Route::get('dealer-transactions', 'AdminController@AdminTransactions'); // sales from Super Admin to Dealers
|
||||
Route::get('admin-dealer-transactions', 'AdminController@getAdminTransactionsJson'); // sales from Super Admin to Dealers
|
||||
// Route::get('organisations/merchants', 'AdminController@getOrganisationMerchants');
|
||||
//organisations/transactions
|
||||
Route::resource('transaction', 'TransactionController');
|
||||
Route::resource('activity', 'ActivityController');
|
||||
Route::resource('topups', 'TopUpsController');
|
||||
Route::resource('users', 'UserController');
|
||||
Route::get('settings', 'SettingsController@index');
|
||||
|
||||
Route::get('dealersales', 'AdminController@getDealerSales');
|
||||
Route::get('dealersales/all', 'AdminController@getTransactionsJson');
|
||||
|
||||
|
||||
Route::get('merchantsales', 'AdminController@getMerchantSales');
|
||||
Route::get('/users/disable/{id}', 'UserController@destroy');
|
||||
});
|
||||
|
||||
/**
|
||||
* Merchant Section
|
||||
*/
|
||||
|
||||
//Merchant Login
|
||||
Route::get('/merchant/login', 'LoginController@merchant_login_page')->middleware('merchant-login');
|
||||
Route::post('/merchant/login', 'LoginController@merchant_login')->middleware('merchant-login');
|
||||
Route::get('/merchant/logout', 'LoginController@merchant_logout')->middleware('merchant-logout')->name('merchant.logout');
|
||||
|
||||
Route::get('/merchant/register', 'LoginController@show_merchant_register');
|
||||
Route::post('/merchant/register', 'LoginController@merchant_register');
|
||||
Route::get('/merchant/register-success', 'LoginController@register_success');
|
||||
Route::post('/merchant/check-country', 'LoginController@checkSupportedCountry');
|
||||
|
||||
|
||||
## Merchant Routes
|
||||
Route::group(['middleware' => ['merchant'],'prefix' => 'merchant'], function () {
|
||||
// Route::get('/', 'DashboardController@merchant');
|
||||
Route::post('/pushrefunds', 'MerchantController@refundStore')->name('pushrefunds');
|
||||
|
||||
Route::get('/change-pin', 'MerchantController@showchangepin');
|
||||
Route::get('/refunds', 'MerchantController@showrefund');
|
||||
Route::get('/transactions', 'MerchantController@transactions');
|
||||
Route::get('/dealertransactions', 'MerchantController@dealer_transactions');
|
||||
Route::get('/dealers', 'MerchantController@get_dealers');
|
||||
|
||||
Route::get('transactions/all', 'MerchantController@getTransactionsJson');
|
||||
Route::get('dealertransactions/all', 'MerchantController@getDealerTransactionsJson');
|
||||
|
||||
Route::get('dealerlist/all', 'MerchantController@getDealerListJson');
|
||||
|
||||
Route::get('/', 'MerchantController@landing');
|
||||
Route::get('landing', 'MerchantController@landing');
|
||||
Route::post('change-pin', 'MerchantController@changePin');
|
||||
|
||||
Route::get('/showtopup', 'MerchantController@showCustomerTopForm');
|
||||
Route::post('/topup', 'MerchantController@customerTopupStore');
|
||||
Route::get('activity', 'MerchantController@getActivity');
|
||||
});
|
||||
|
||||
|
||||
//Organisation Login
|
||||
Route::post('organisation/resetpassword', 'OrganisationLoginController@resetpassword');
|
||||
Route::get('organisation/reset-password', 'OrganisationLoginController@resetCreate');
|
||||
|
||||
Route::get('/organisation/login', 'OrganisationLoginController@login_page');
|
||||
Route::get('/dealer/login', 'OrganisationLoginController@login_page');
|
||||
|
||||
Route::get('/dealer/register', 'OrganisationLoginController@register_page');
|
||||
Route::post('/dealer/register', 'OrganisationLoginController@register');
|
||||
Route::get('/dealer/register-success', 'OrganisationLoginController@register_success');
|
||||
|
||||
|
||||
Route::post('/organisation/login', 'OrganisationLoginController@handleLogin');
|
||||
Route::get('/organisation/logout', 'OrganisationLoginController@logout')->name('organisation.logout');
|
||||
|
||||
# Organisation/Dealer Routes
|
||||
Route::group(['middleware' => ['organisation'],'prefix' => 'organisation'], function () {
|
||||
Route::get('/', 'OrganisationsController@landing');
|
||||
Route::get('landing', 'OrganisationsController@landing')->name('organisation.dashboard');
|
||||
Route::get('dashboard', 'OrganisationsController@landing');
|
||||
|
||||
|
||||
Route::get('/transactions', 'OrganisationsController@transactions');
|
||||
Route::get('transactions/all', 'OrganisationsController@getTransactionsJson');
|
||||
|
||||
Route::get('/mytopups', 'OrganisationsController@mytopups');
|
||||
Route::get('mytopups/all', 'OrganisationsController@getMyTopUpsJson');
|
||||
|
||||
Route::get('/merchants', 'OrganisationsController@index');
|
||||
Route::get('/merchants/create', 'OrganisationsController@create');
|
||||
|
||||
Route::get('/showtopup', 'OrganisationsController@showCustomerTopForm');
|
||||
Route::post('/topup', 'OrganisationsController@merchantTopupStore')->name('dealer.topup');
|
||||
Route::get('/topupotp', 'OrganisationsController@merchantTopupOtpStore');
|
||||
|
||||
//Merchant Controller
|
||||
Route::resource('merchant', 'MerchantController');
|
||||
|
||||
Route::get('/merchant/enable/{id}', 'MerchantController@enable');
|
||||
Route::get('/merchant/delete/{id}', 'MerchantController@destroy');
|
||||
// Route::post('/reseller/add-topup', 'MerchantController@addTopUp');
|
||||
|
||||
Route::get('/activity', 'OrganisationsController@getActivity')->name('organisation.activity');
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user