group(function () { Route::get('/dashboard', function () { $chart = new ExampleChart(new LarapexChart()); $people = Person::with(['group','type', 'client', 'clientCase']) ->where([ ['active','=',1], ]) ->limit(10) ->orderByDesc('created_at') ->get(); return Inertia::render( 'Dashboard', [ 'chart' => $chart->build(), 'people' => $people ] ); })->name('dashboard'); Route::get('testing', function() { return Inertia::render('Testing', []); }); Route::get('search', function(Request $request) { if( !empty($request->input('query')) ) { $clients = App\Models\Client::search($request->input('query')) ->query(function($q) use($request) { $q->with('person')->limit($request->input('limit')); }) ->get(); $clientCases = App\Models\ClientCase::search($request->input('query')) ->query(function($q) use($request) { $q->with('person')->limit($request->input('limit')); }) ->get(); return [ 'clients' => $clients, 'client_cases' => $clientCases ]; } return []; })->name('search'); //client 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'); });