Init(Core): add to repo and add seeders

This commit is contained in:
2026-04-28 22:48:42 +03:30
commit be6b699ff0
205 changed files with 22524 additions and 0 deletions

85
routes/api.php Normal file
View File

@@ -0,0 +1,85 @@
<?php
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\CmsController;
use App\Http\Controllers\PimController;
use App\Http\Controllers\ImageController;
/*
|--------------------------------------------------------------------------
| 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::post('/postman', function(Request $request) {
$user = User::where('email', $request['email'])->first();
$token = $user->createToken('auth_token')->plainTextToken;
return response($token);
});
Route::group(['middleware' => 'auth:sanctum'], function () {
Route::get('/token', function(){
return response(auth()->user()->token);
});
Route::group(['prefix' => '/images'], function () {
Route::post('/{service}/createOn/{model}/{id}', [ImageController::class, 'createOn']);
Route::post('/delete/{id}', [ImageController::class, 'delete']);
});
Route::group(['prefix' => '/categories'], function () {
Route::get('/index', [PimController::class, 'categories_index']);
Route::get('/show/{category_id}', [PimController::class, 'categories_show']);
Route::post('/store', [PimController::class, 'categories_store']);
Route::put('/update/{category_id}', [PimController::class, 'categories_update']);
Route::delete('/delete/{category_id}', [PimController::class, 'categories_delete']);
});
Route::group(['prefix' => '/properties'], function () {
Route::get('/index', [PimController::class, 'properties_index']);
Route::get('/show/{property_id}', [PimController::class, 'properties_show']);
Route::post('/store/{category_id}', [PimController::class, 'properties_store']);
Route::put('/update/{property_id}', [PimController::class, 'properties_update']);
Route::delete('/delete/{property_id}', [PimController::class, 'properties_delete']);
Route::post('/{property_id}/attachCategory/{category_id}', [PimController::class, 'properties_attach_category']);
Route::post('/{property_id}/detachCategory/{category_id}', [PimController::class, 'properties_detach_category']);
});
Route::group(['prefix' => '/products'], function () {
Route::post('/store/{category_id}', [PimController::class, 'products_store']);
Route::put('/update/{product_id}', [PimController::class, 'products_update']);
Route::delete('/delete/{product_id}', [PimController::class, 'products_delete']);
});
Route::group(['prefix' => '/orders'], function () {
Route::get('/index', [PimController::class, 'orders_index']);
Route::get('/show/{order_id}', [PimController::class, 'orders_show']);
Route::post('/setStatus/{order_id}', [PimController::class, 'orders_setStatus']);
});
Route::group(['prefix' => '/content'], function () {
Route::post('/update/{content_id}', [CmsController::class, 'content_update']);
});
Route::group(['prefix' => '/blog'], function () {
route::post('/store', [cmscontroller::class, 'blog_create']);
route::post('/update/{blog_id}', [cmscontroller::class, 'blog_update']);
route::delete('/delete/{blog_id}', [cmscontroller::class, 'blog_delete']);
});
});

12
routes/auth.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
use App\Http\Controllers\Auth\AuthenticatedSessionController;
use Illuminate\Support\Facades\Route;
Route::post('login', [AuthenticatedSessionController::class, 'store']);
Route::middleware('auth')->group(function () {
Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])
->name('logout');
});

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');

19
routes/web.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
use Inertia\Inertia;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Application;
use App\Http\Controllers\PimController;
/*
|--------------------------------------------------------------------------
| 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!
|
*/
require __DIR__.'/auth.php';