first commit

This commit is contained in:
Simon Pocrnjič
2024-10-28 21:08:16 +01:00
commit 90a5858320
199 changed files with 21177 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
<?php
use App\Http\Resources\PersonCollection;
use App\Models\Person\Person;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
Route::get('/user', function (Request $request) {
return $request->user();
})->middleware('auth:sanctum');
Route::get('/person', function(){
return new PersonCollection(Person::all());
})->middleware('auth:sanctum');
+8
View File
@@ -0,0 +1,8 @@
<?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote')->hourly();
+59
View File
@@ -0,0 +1,59 @@
<?php
use App\Charts\ExampleChart;
use App\Http\Controllers\ClientController;
use App\Http\Controllers\ContractController;
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::middleware([
'auth:sanctum',
config('jetstream.auth_session'),
'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))
->where([
['person.active','=',1],
['person.group_id','=',1]
])
->limit(10)
->orderBy('id', 'desc')
->get();
return Inertia::render(
'Dashboard',
[
'chart' => $chart->build(),
'clients' => $clients
]
);
})->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');
//contract
Route::Post('contract', [ContractController::class, 'store'])->name('contract.store');
});