init
This commit is contained in:
19
web10/routes/api.php
Normal file
19
web10/routes/api.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
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 and all of them will
|
||||
| be assigned to the "api" middleware group. Make something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
||||
return $request->user();
|
||||
});
|
||||
18
web10/routes/channels.php
Normal file
18
web10/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
web10/routes/console.php
Normal file
19
web10/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');
|
||||
48
web10/routes/web.php
Normal file
48
web10/routes/web.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\ArticleController;
|
||||
use App\Http\Controllers\CategoryController;
|
||||
use App\Http\Controllers\CommentController;
|
||||
use App\Http\Controllers\ContactController;
|
||||
use App\Http\Controllers\HomeController;
|
||||
use App\Http\Controllers\OutboundController;
|
||||
use App\Http\Controllers\PageController;
|
||||
use App\Http\Controllers\ProductController;
|
||||
use App\Http\Controllers\SearchController;
|
||||
use App\Http\Controllers\SitemapController;
|
||||
use App\Http\Controllers\TagController;
|
||||
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 and all of them will
|
||||
| be assigned to the "web" middleware group. Make something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::get('/', [HomeController::class, 'index'])->name('home');
|
||||
Route::get('/categories', [CategoryController::class, 'index'])->name('categories.index');
|
||||
Route::get('/category/{slug}', [CategoryController::class, 'show'])->name('categories.show');
|
||||
Route::get('/tags', [TagController::class, 'index'])->name('tags.index');
|
||||
Route::get('/tag/{slug}', [TagController::class, 'show'])->name('tags.show');
|
||||
Route::get('/product/{slug}', [ProductController::class, 'show'])->name('products.show');
|
||||
Route::get('/articles', [ArticleController::class, 'index'])->name('articles.index');
|
||||
Route::get('/article/{slug}', [ArticleController::class, 'show'])->name('articles.show');
|
||||
Route::get('/about', [PageController::class, 'about'])->name('about');
|
||||
Route::get('/contact', [ContactController::class, 'show'])->name('contact.show');
|
||||
Route::post('/contact', [ContactController::class, 'store'])->name('contact.store');
|
||||
Route::get('/search', [SearchController::class, 'index'])->name('search.index');
|
||||
Route::get('/out/{slug}', [OutboundController::class, 'redirect'])->name('outbound');
|
||||
Route::post('/comments', [CommentController::class, 'store'])->name('comments.store');
|
||||
Route::post('/comments/{comment}/like', [CommentController::class, 'like'])->name('comments.like');
|
||||
Route::get('/captcha', [CommentController::class, 'captcha'])->name('comments.captcha');
|
||||
Route::get('/sitemap.xml', [SitemapController::class, 'index'])->name('sitemap');
|
||||
Route::get('/robots.txt', function () {
|
||||
$content = "User-agent: *\nDisallow: /admin\nSitemap: " . url('/sitemap.xml');
|
||||
|
||||
return response($content, 200)->header('Content-Type', 'text/plain');
|
||||
});
|
||||
Reference in New Issue
Block a user