source: routes/web.php

Last change on this file was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago
  • Initial commit;
  • Property mode set to 100644
File size: 4.4 KB
Line 
1<?php
2
3use App\Http\Controllers\ArtistController;
4use App\Http\Controllers\Auth\VerificationController;
5use App\Http\Controllers\InviteManagerController;
6use App\Http\Controllers\InvoiceController;
7use App\Http\Controllers\MainController;
8use App\Http\Controllers\EventController;
9use App\Http\Controllers\ManagerAuth\RegisterController;
10use App\Http\Controllers\ManagerController;
11use App\Http\Controllers\OfferController;
12use App\Http\Controllers\OnboardingController;
13use App\Http\Controllers\OrganizerController;
14use App\Http\Controllers\ProfileController;
15use App\Http\Controllers\ReviewController;
16use App\Http\Controllers\TransactionController;
17use Illuminate\Support\Facades\Auth;
18use Illuminate\Support\Facades\Route;
19
20/*
21|--------------------------------------------------------------------------
22| Web Routes
23|--------------------------------------------------------------------------
24|
25| Here is where you can register web routes for your application. These
26| routes are loaded by the RouteServiceProvider within a group which
27| contains the "web" middleware group. Now create something great!
28|
29*/
30
31Auth::routes(['verify' => true]);
32
33Route::get('/', function () {
34 return redirect('/explore');
35})->name('main.welcome');
36
37Route::get('/explore', [MainController::class, 'index']);
38
39Route::prefix('manager')->group(function () {
40 Route::get('/register/{token}', [RegisterController::class, 'showRegistrationForm'])->name('manager.register')->middleware('invitation.token');
41 Route::post('/register', [RegisterController::class, 'register'])->name('manager.register.submit');
42});
43
44/* PROTECTED ROUTES */
45Route::middleware(['auth', 'verified'])->group(function () {
46 Route::get('/onboarding', [OnboardingController::class, 'index'])->name('onboarding');
47 Route::post('/onboarding', [OnboardingController::class, 'create'])->name('onboarding.create');
48
49 Route::group(['middleware' => ['onboarding']], function () {
50 /* EVENTS */
51 Route::prefix('events')->group(function () {
52 Route::get('/', [EventController::class, 'index'])->name('organizer.events');
53 Route::get('/create', [EventController::class, 'create']);
54 Route::get('/create/{username}', [EventController::class, 'create']);
55 Route::get('/{slug}', [EventController::class, 'show']);
56 Route::get('/edit/{slug}', [EventController::class, 'edit']);
57 Route::post('/edit/{id}', [EventController::class, 'update']);
58 Route::post('/create', [EventController::class, 'store']);
59 });
60
61 Route::prefix('payments')->group(function () {
62 Route::get('/', [TransactionController::class, 'index']);
63 Route::post('/{id}/purchase', [TransactionController::class, 'purchase'])->name('payments.purchase');
64// Route::get('/billing-portal', [TransactionController::class, 'billingPortal']);
65 });
66
67 /* OFFER */
68 Route::prefix('offers')->group(function () {
69 Route::get('/', [OfferController::class, 'index']);
70 Route::get('/{slug}', [OfferController::class, 'show']);
71 Route::get('/create/{username}', [OfferController::class, 'create']);
72 Route::post('/create', [OfferController::class, 'store']);
73 Route::post('/reply', [OfferController::class, 'writeComment']);
74 Route::post('/set-price', [OfferController::class, 'setPrice']);
75 Route::post('/decline', [OfferController::class, 'declineOffer']);
76 Route::post('/accept', [OfferController::class, 'acceptOffer']);
77 });
78
79 Route::prefix('invoices')->group(function () {
80 Route::get('/{invoiceId}', [InvoiceController::class, 'show']);
81 });
82
83 /* ARTISTS */
84 Route::prefix('artists')->group(function () {
85 Route::get('/', [ManagerController::class, 'index']);
86 Route::post('/review', [ReviewController::class, 'store']);
87 Route::post('/manager/invite', [InviteManagerController::class, 'storeInvitation']);
88 });
89
90 /* MANAGER */
91 Route::prefix('manager')->group(function () {
92 Route::get('/accept/{token}', [InviteManagerController::class, 'accept'])->name('manager.accept.invite')->middleware('invitation.token');
93 });
94 });
95});
96
97Route::get('/{username}', [ProfileController::class, 'show']);
98Route::get('/{username}/manager', [ArtistController::class, 'showManager']);
99Route::post('/{username}/manager/remove', [ArtistController::class, 'removeManager']);
100
101
102
Note: See TracBrowser for help on using the repository browser.