Init(Core): add project to git and add seeders and factory

This commit is contained in:
2026-04-28 21:29:43 +03:30
commit 15bd23cdd2
101 changed files with 12093 additions and 0 deletions

89
routes/api.php Normal file
View File

@@ -0,0 +1,89 @@
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\ContentController;
use App\Http\Controllers\PageController;
use App\Http\Controllers\PostController;
use App\Http\Controllers\Admin\{
PageController as AdminPageController,
ContentController as AdminContentController,
PostController as AdminPostController,
ImageController as AdminImageController,
};
/*
|--------------------------------------------------------------------------
| 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();
});
Route::group(['prefix' => '/public'], function (){
Route::group(['prefix' => '/pages'], function (){
Route::get ('/index/{user_token}', [PageController::class, 'index']);
Route::get ('/show/{page}', [PageController::class, 'show']);
});
Route::group(['prefix' => '/content'], function (){
Route::get ('/index/{page}', [ContentController::class, 'index']);
Route::get ('/show/{content}', [ContentController::class, 'show']);
});
Route::group(['prefix' => '/blog'], function (){
Route::get ('/index/{user_token}', [PostController::class, 'index']);
Route::get ('/show/{post}', [PostController::class, 'show']);
});
});
Route::group(['prefix' => '/admin', 'middleware' => ['checksecret']], function (){
Route::group(['prefix' => '/pages'], function (){
Route::post ('/create', [AdminPageController::class, 'create']);
Route::put ('/update/{page}', [AdminPageController::class, 'update']);
Route::delete('/delete/{page}', [AdminPageController::class, 'destroy']);
});
Route::group(['prefix' => '/content'], function (){
Route::post ('/create/{page}', [AdminContentController::class, 'store']);
Route::post ('/update/{content}', [AdminContentController::class, 'update']);
Route::delete('/delete/{content}', [AdminContentController::class, 'destroy']);
});
Route::group(['prefix' => '/blog'], function (){
Route::post('/create', [AdminPostController::class, 'store']);
Route::post('/update/{post}', [AdminPostController::class, 'update']);
Route::delete('/delete/{post}', [AdminPostController::class, 'delete']);
});
Route::group(['prefix' => '/images'], function (){
Route::post('/create/{post}', [AdminImageController::class, 'store']);
});
});

18
routes/channels.php Normal file
View 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
View 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');

18
routes/web.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
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('/', function () {
return view('welcome');
});