%PDF- %PDF-
Direktori : /home/forge/api-takeaseat.eco-n-tech.co.uk/routes/ |
Current File : //home/forge/api-takeaseat.eco-n-tech.co.uk/routes/api.php |
<?php use Illuminate\Support\Facades\Route; /* |-------------------------------------------------------------------------- | 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('session-types', ListSessionTypes::class)->name('session-types'); Route::get('languages', ListLanguages::class)->name('languages'); Route::get('location/{slug}', 'LocationController@show')->name('location'); Route::apiResource('user.messages', MessageController::class); Route::prefix('specialisms')->name('specialisms.')->group(function () { Route::get('/', 'SpecialismController@index')->name('index'); Route::get('/{slug}', 'SpecialismController@show')->name('show'); }); Route::prefix('metatags')->name('metatags.')->group(function () { Route::get('/get', 'MetatagsController@show')->name('show'); }); Route::prefix('tags')->name('tags.')->group(function () { Route::get('/', 'TagController@index')->name('index'); Route::get('/{slug}', 'TagController@show')->name('show'); }); // Blog Routes Route::prefix('posts')->name('post.')->group(function () { Route::get('/', 'PostController@index')->name('list'); Route::get('{slug}', 'PostController@show')->name('show'); Route::post('/like/{id}', 'PostController@like')->name('like'); Route::post('/filters', PostFilterController::class)->name('filters'); }); Route::prefix('content')->name('content.')->group(function () { Route::get('/policies', 'PolicyController@index')->name('policies'); }); Route::prefix('password')->name('password.')->group(function () { Route::get('reset', 'Auth\ForgotPasswordController@index')->name('reset'); Route::post('email', 'Auth\ForgotPasswordController@forgot'); Route::post('reset', 'Auth\ForgotPasswordController@reset'); }); // Authenticate Routes Route::prefix('auth')->group(function () { Route::get('user', 'Auth\AuthController@index')->name('user'); Route::post('refresh', 'Auth\AuthController@refresh')->name('refresh'); Route::post('login', 'Auth\LoginController@login')->name('login'); Route::post('logout', 'Auth\LoginController@logout')->name('logout'); Route::post('register', 'Auth\RegisterController@register')->name('register'); // Therapist Registration Route::prefix('therapist')->name('therapist.')->group(function () { Route::post('register', 'Auth\Therapist\RegisterController@register')->name('register'); }); }); Route::prefix('invitation')->name('invitation.')->group(function () { Route::get('{reference}', 'Therapist\Invitations\InvitationController@read')->name('read'); Route::post('accept/{reference}', Therapist\Invitations\AcceptInvitation::class)->name('accept'); }); // Therapist Routes Route::prefix('therapists')->name('therapist.')->group(function () { Route::post('/', ListTherapists::class)->name('list'); Route::post('{slug}', ShowTherapist::class)->name('therapists.show'); Route::get('/filters', TherapistFilterController::class)->name('filters'); }); // Booking Routes Route::prefix('booking')->name('booking.')->group(function () { Route::get('/intent/{id}', Booking\BookingIntent::class)->name('intent'); Route::get('/list', Booking\ListBookings::class)->name('list')->middleware('auth:api'); Route::post('summary', Booking\SummaryController::class)->name('summary'); Route::post('create', Booking\CreateBooking::class)->name('create')->middleware('auth:api'); Route::post('cancel/{id}', Booking\CancelBooking::class)->name('cancel')->middleware('auth:api'); Route::prefix('payment')->name('payment.')->group(function () { Route::post('/{seller_id}', Booking\Payment\CreatePayment::class)->name('pay'); Route::post('/intent/{seller_id}', Booking\Payment\PaymentIntent::class)->name('intent'); }); Route::prefix('reschedule')->name('reschedule.')->group(function () { Route::get('{id}', 'Booking\ReschedulingController@show')->name('booking')->middleware('auth:api'); Route::post('{id}', 'Booking\ReschedulingController@update')->name('update')->middleware('auth:api'); }); }); Route::prefix('availability')->name('availability.')->group(function () { Route::post('{id}', Availability\GetAvailability::class); Route::post('/next/{id}', Availability\GetNextAvailabiliity::class); }); // Therapist Dashboard Routes Route::group(['middleware' => ['auth:api', 'role:therapist']], function () { Route::prefix('therapist')->name('therapist.')->group(function () { Route::get('dashboard', 'Therapist\DashboardController@index')->name('clients'); Route::prefix('clients')->name('clients.')->group(function () { Route::get('/', 'Therapist\ClientController@index')->name('/'); Route::get('/{id}', 'Therapist\ClientController@show')->name('clients.show'); }); Route::prefix('invitations')->name('invitations.')->group(function () { Route::get('/', 'Therapist\Invitations\InvitationController@index')->name('index'); Route::post('/create', 'Therapist\Invitations\InvitationController@create')->name('create'); }); Route::prefix('bookings')->name('bookings.')->group(function () { Route::get('/', 'Therapist\BookingController@index')->name('index'); Route::post('create/{id}', 'Therapist\BookingController@create')->name('create'); }); Route::prefix('money')->name('money.')->group(function () { Route::get('/', 'Therapist\MoneyManagerController@index')->name('index'); Route::get('/payments', 'Therapist\PaymentController@index')->name('payments'); Route::post('/statement', 'Therapist\PaymentController@statement')->name('statement'); }); }); }); // Account Routes (All Roles) Route::group(['middleware' => 'auth:api'], function () { Route::prefix('account')->name('account.')->group(function () { Route::get('progress', Account\ProgressController::class)->name('progress'); Route::post('change-password', Account\Details\ChangePassword::class)->name('update.password'); // Account Details Routes Route::prefix('details')->name('details.')->group(function () { Route::prefix('personal')->name('personal.')->group(function () { Route::get('/', 'Account\Details\PersonalController@index')->name('index'); Route::post('/update', 'Account\Details\PersonalController@update')->name('update'); }); Route::prefix('business')->name('business.')->group(function () { Route::get('/', 'Account\Details\BusinessController@index')->name('index'); Route::post('/', 'Account\Details\BusinessController@update')->name('update'); }); Route::prefix('social')->name('social.')->group(function () { Route::get('/', 'Account\Details\SocialLinksController@index')->name('index'); Route::post('update', 'Account\Details\SocialLinksController@update')->name('update'); }); Route::prefix('addresses')->name('addresses.')->group(function () { Route::get('/', 'Account\Details\AddressController@index')->name('index'); Route::post('update', 'Account\Details\AddressController@update')->name('update'); }); }); // Account Profile Routess Route::prefix('profile')->name('profile.')->group(function () { Route::post('photo', 'Account\Profile\PhotoController@store')->name('photo'); Route::post('images/upload', 'Account\Profile\ImageController@store')->name('images.upload'); Route::prefix('questions')->name('questions.')->group(function () { Route::post('/', 'Account\Profile\QuestionController@index')->name('list'); Route::post('create', 'Account\Profile\QuestionController@create')->name('create'); }); Route::prefix('products')->name('products.')->group(function () { Route::get('/', 'Account\Profile\ProductController@index')->name('list'); Route::post('create', 'Account\Profile\ProductController@create')->name('create'); }); }); Route::prefix('availability')->name('availability.')->group(function () { Route::get('/', 'Account\AvailabilityController@index')->name('index'); Route::post('/create', 'Account\AvailabilityController@create')->name('create'); Route::post('/delete/{id}', 'Account\AvailabilityController@delete')->name('delete'); }); // Account Verification Routes Route::prefix('verification')->name('verification.')->group(function () { Route::prefix('qualifications')->name('qualifications.')->group(function () { Route::post('/', 'Account\Verification\QualificationController@index')->name('list'); Route::post('create', 'Account\Verification\QualificationController@create')->name('create'); }); Route::prefix('memberships')->name('memberships.')->group(function () { Route::post('/', 'Account\Verification\MembershipController@index')->name('list'); Route::post('create', 'Account\Verification\MembershipController@create')->name('create'); }); Route::prefix('insurance')->name('insurance.')->group(function () { Route::post('/', 'Account\Verification\InsuranceController@index')->name('list'); Route::post('create', 'Account\Verification\InsuranceController@create')->name('create'); }); Route::prefix('supervisor')->name('supervisor.')->group(function () { Route::post('/', 'Account\Verification\SupervisorController@index')->name('list'); Route::post('create', 'Account\Verification\SupervisorController@create')->name('create'); }); }); Route::prefix('settings')->name('settings.')->group(function () { Route::get('/', 'Account\SettingsController@index')->name('index'); Route::post('/', 'Account\SettingsController@update')->name('update'); }); }); }); // Account Profile Routes (Therapist) Route::group(['middleware' => ['auth:api', 'role:therapist']], function () { Route::prefix('profile')->name('profile.')->group(function () { Route::get('/', 'Account\Profile\ProfileController@index')->name('index'); Route::post('update', 'Account\Profile\ProfileController@update')->name('update'); // Session Types Route::prefix('session-types')->name('session-types.')->group(function () { Route::get('/', 'Account\Profile\SessionTypeController@index')->name('index'); Route::post('update', 'Account\Profile\SessionTypeController@update')->name('update'); }); // Session Types Route::prefix('specialisms')->name('specialisms.')->group(function () { Route::get('/', 'Account\Profile\SpecialismController@index')->name('index'); Route::post('update', 'Account\Profile\SpecialismController@update')->name('update'); }); }); // Stripe Routes Route::prefix('stripe')->name('stripe.')->group(function () { Route::get('account', Account\Stripe\GetStripeAccount::class)->name('account'); Route::get('account-link', Account\Stripe\CreateAccountLink::class)->name('account-link'); Route::get('login-link', Account\Stripe\CreateLoginLink::class)->name('login-link'); }); }); // Payments & cards Route::prefix('payments')->name('payments.')->middleware('auth:api')->group(function () { Route::prefix('cards')->name('card.')->group(function () { Route::get('/', Account\Payment\ListPaymentMethods::class)->name('list'); Route::get('setup', Account\Payment\CreateSetupIntent::class)->name('setup'); Route::post('update', Account\Payment\UpdatePrimaryPaymentMethod::class)->name('update'); Route::post('create', Account\Payment\AddPaymentMethod::class)->name('create'); Route::post('delete', Account\Payment\DeletePaymentMethod::class)->name('delete'); }); }); // Subscriptions Route::group(['middleware' => ['auth:api', 'role:therapist']], function () { Route::prefix('subscription')->name('subscription.')->group(function () { Route::get('/', 'Account\SubscriptionController@index')->name('get'); Route::post('create', 'Account\SubscriptionController@create')->name('create'); Route::post('resume', 'Account\SubscriptionController@resume')->name('resume'); Route::post('update', 'Account\SubscriptionController@update')->name('update'); Route::post('cancel', 'Account\SubscriptionController@cancel')->name('cancel'); Route::prefix('discount')->name('discount.')->group(function () { Route::post('create', Account\Stripe\AddDiscountCode::class)->name('create'); }); }); });