Lots of changes
This commit is contained in:
+23
-25
@@ -1,24 +1,16 @@
|
||||
<?php
|
||||
|
||||
use App\Charts\ExampleChart;
|
||||
use App\Http\Controllers\ClientCaseContoller;
|
||||
use App\Http\Controllers\ClientController;
|
||||
use App\Http\Controllers\ContractController;
|
||||
use App\Http\Controllers\SettingController;
|
||||
use App\Models\Person\Person;
|
||||
use ArielMejiaDev\LarapexCharts\LarapexChart;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Inertia\Inertia;
|
||||
|
||||
Route::get('/', function () {
|
||||
return Inertia::render('Welcome', [
|
||||
'canLogin' => Route::has('login'),
|
||||
'canRegister' => Route::has('register'),
|
||||
'laravelVersion' => Application::VERSION,
|
||||
'phpVersion' => PHP_VERSION,
|
||||
]);
|
||||
});
|
||||
|
||||
//Route::get('/person', [PersonController::class, 'index'])->middleware('auth:sanctum',config('jetstream.auth_session'), 'verified');
|
||||
Route::redirect('/', 'login');
|
||||
|
||||
Route::middleware([
|
||||
'auth:sanctum',
|
||||
@@ -26,34 +18,40 @@
|
||||
'verified',
|
||||
])->group(function () {
|
||||
Route::get('/dashboard', function () {
|
||||
$person = new Person();
|
||||
$chart = new ExampleChart(new LarapexChart());
|
||||
$clients = $person::with(['group','type'])
|
||||
->whereHas('group', fn($que) => $que->where('deleted','=',0))
|
||||
->whereHas('type', fn($que) => $que->where('deleted','=',0))
|
||||
$people = Person::with(['group','type', 'client', 'clientCase'])
|
||||
->where([
|
||||
['person.active','=',1],
|
||||
['person.group_id','=',1]
|
||||
['active','=',1],
|
||||
])
|
||||
->limit(10)
|
||||
->orderBy('id', 'desc')
|
||||
->orderByDesc('created_at')
|
||||
->get();
|
||||
|
||||
return Inertia::render(
|
||||
'Dashboard',
|
||||
[
|
||||
'chart' => $chart->build(),
|
||||
'clients' => $clients
|
||||
'people' => $people
|
||||
]
|
||||
);
|
||||
})->name('dashboard');
|
||||
|
||||
//client
|
||||
Route::get('client', [ClientController::class, 'index'])->name('client');
|
||||
Route::get('client/{uuid}', [ClientController::class, 'show'])->name('client.show');
|
||||
Route::post('client', [ClientController::class, 'store'])->name('client.store');
|
||||
Route::get('clients', [ClientController::class, 'index'])->name('client');
|
||||
Route::get('clients/{client:uuid}', [ClientController::class, 'show'])->name('client.show');
|
||||
Route::post('clients', [ClientController::class, 'store'])->name('client.store');
|
||||
|
||||
//client-case
|
||||
Route::get('client-cases', [ClientCaseContoller::class, 'index'])->name('clientCase');
|
||||
Route::get('client-cases/{client_case:uuid}', [ClientCaseContoller::class, 'show'])->name('clientCase.show');
|
||||
Route::post('client-cases', [ClientCaseContoller::class, 'store'])->name('clientCase.store');
|
||||
//client-case / contract
|
||||
Route::post('client-cases/{client_case:uuid}/contract', [ClientCaseContoller::class, 'storeContract'])->name('clientCase.contract.store');
|
||||
Route::put('client-cases/{client_case:uuid}/contract/{uuid}', [ClientCaseContoller::class, 'updateContract'])->name('clientCase.contract.update');
|
||||
Route::delete('client-cases/{client_case:uuid}/contract/{uuid}', [ClientCaseContoller::class, 'deleteContract'])->name('clientCase.contract.delete');
|
||||
//client-case / activity
|
||||
Route::post('client-cases/{client_case:uuid}/activity', [ClientCaseContoller::class, 'storeActivity'])->name('clientCase.activity.store');
|
||||
|
||||
Route::get('settings', [SettingController::class, 'index'])->name('settings');
|
||||
|
||||
//contract
|
||||
Route::Post('contract', [ContractController::class, 'store'])->name('contract.store');
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user