Session Total cost: $8.64 (costs may be inaccurate due to usage of unknown models) Total duration (API): 1h 16m 9s Total duration (wall): 1h 59m 9s Total code changes: 4094 lines added, 229 lines removed Usage by model: qwen/qwen3.6-35b-a3b: 432.0k input, 112.9k output, 18.6m cache read, 0 cache write ($8.56) claude-haiku-4-5: 9.4k input, 13.3k output, 8.3k cache read, 0 cache write ($0.0767) Runtime: llamacpp Model: Qwen 3.6 35B A3B Q4 K M Coding Agent: ClaudeCode
83 lines
2.6 KiB
PHP
83 lines
2.6 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\OrganizationController;
|
|
use App\Models\User;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\Hash;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
// Homepage
|
|
Route::get('/', function () {
|
|
return view('home');
|
|
})->name('home');
|
|
|
|
// Auth pages
|
|
Route::get('/login', function () {
|
|
return view('auth.login');
|
|
})->name('login');
|
|
|
|
Route::post('/login', function (Request $request) {
|
|
$validated = $request->validate([
|
|
'email' => ['required', 'email'],
|
|
'password' => ['required'],
|
|
]);
|
|
|
|
if (Auth::attempt(['email' => $validated['email'], 'password' => $validated['password']], $request->boolean('remember'))) {
|
|
$request->session()->regenerate();
|
|
|
|
return redirect()->route('dashboard');
|
|
}
|
|
|
|
return back()->withErrors([
|
|
'email' => 'The provided credentials do not match our records.',
|
|
])->onlyInput('email');
|
|
})->name('login.post');
|
|
|
|
Route::get('/register', function () {
|
|
return view('auth.register');
|
|
})->name('register');
|
|
|
|
Route::post('/register', function (Request $request) {
|
|
$validated = $request->validate([
|
|
'first_name' => ['required', 'string', 'max:255'],
|
|
'last_name' => ['required', 'string', 'max:255'],
|
|
'email' => ['required', 'email', 'max:255', 'unique:users,email'],
|
|
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
|
]);
|
|
|
|
$user = User::create([
|
|
'name' => $validated['first_name'].' '.$validated['last_name'],
|
|
'email' => $validated['email'],
|
|
'password' => Hash::make($validated['password']),
|
|
'has_organization' => false,
|
|
]);
|
|
|
|
Auth::login($user);
|
|
$request->session()->regenerate();
|
|
|
|
return redirect()->route('dashboard');
|
|
})->name('register.post');
|
|
|
|
// Organization CRUD
|
|
Route::middleware('auth')->group(function () {
|
|
Route::post('/organizations', [OrganizationController::class, 'store'])->name('organizations.store');
|
|
Route::delete('/organizations/{organization}', [OrganizationController::class, 'destroy'])->name('organizations.destroy');
|
|
Route::put('/organizations/{organization}/switch', [OrganizationController::class, 'switch'])->name('organizations.switch');
|
|
});
|
|
|
|
// Dashboard
|
|
Route::get('/dashboard', function () {
|
|
return view('dashboard');
|
|
})->name('dashboard');
|
|
|
|
// Organization management
|
|
Route::middleware('auth')->group(function () {
|
|
Route::get('/organizations/{organization}', [OrganizationController::class, 'show'])->name('organizations.show');
|
|
});
|
|
|
|
// Feature pages
|
|
Route::get('/features/{feature}', function ($feature) {
|
|
return view('features.show', ['feature' => $feature]);
|
|
})->name('features');
|