initial
This commit is contained in:
51
routes/api.php
Normal file
51
routes/api.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\Api\AuthController;
|
||||
use App\Http\Controllers\Api\UserController;
|
||||
use App\Http\Controllers\Api\PostController;
|
||||
use App\Http\Controllers\Api\EventController;
|
||||
use App\Http\Controllers\Api\MediaController;
|
||||
use App\Http\Controllers\Api\ContactController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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::post('/login', [AuthController::class, 'login']);
|
||||
Route::post('/register', [UserController::class, 'register']);
|
||||
|
||||
Route::apiResource('users', UserController::class);
|
||||
Route::post('/users/forgotUsername', [UserController::class, 'forgotUsername']);
|
||||
Route::post('/users/forgotPassword', [UserController::class, 'forgotPassword']);
|
||||
Route::post('/users/resetPassword', [UserController::class, 'resetPassword']);
|
||||
Route::post('/users/resendVerifyEmailCode', [UserController::class, 'resendVerifyEmailCode']);
|
||||
Route::post('/users/verifyEmail', [UserController::class, 'verifyEmail']);
|
||||
|
||||
Route::apiResource('media', MediaController::class);
|
||||
Route::get('media/{medium}/download', [MediaController::class, 'download']);
|
||||
|
||||
Route::apiResource('posts', PostController::class);
|
||||
|
||||
Route::apiResource('events', EventController::class);
|
||||
|
||||
Route::apiResource('subscriptions', SubscriptionController::class);
|
||||
|
||||
Route::post('/contact', [ContactController::class, 'send']);
|
||||
|
||||
|
||||
Route::middleware('auth:sanctum')->group(function () {
|
||||
Route::post('/logout', [AuthController::class, 'logout']);
|
||||
Route::get('/me', [AuthController::class, 'me']);
|
||||
});
|
||||
|
||||
Route::any('{any}', function () {
|
||||
return response()->json(['message' => 'Resource not found'], 404);
|
||||
})->where('any', '.*');
|
||||
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');
|
||||
23
routes/web.php
Normal file
23
routes/web.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use App\Mail\EmailVerify;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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('/test-email', function () {
|
||||
return new EmailVerify();
|
||||
});
|
||||
|
||||
Route::get('/{any}', function () {
|
||||
return view('app');
|
||||
})->where('any', '.*');
|
||||
Reference in New Issue
Block a user