Initial commit: CABM-IT (ItGlue-style MSP documentation platform)
Laravel 13 + Livewire/Volt app for managing client organizations, documents, passwords, flexible assets, virtual machines, contacts, domains, todos, shortcuts, and role-based user administration.
This commit is contained in:
@@ -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');
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Contact;
|
||||
use App\Models\Document;
|
||||
use App\Models\Domain;
|
||||
use App\Models\FlexibleAsset;
|
||||
use App\Models\FlexibleAssetType;
|
||||
use App\Models\Location;
|
||||
use App\Models\Organization;
|
||||
use App\Models\Password;
|
||||
use App\Models\Shortcut;
|
||||
use App\Models\Todo;
|
||||
use App\Models\User;
|
||||
use App\Models\VirtualMachine;
|
||||
use App\Http\Controllers\DocumentDownloadController;
|
||||
use App\Http\Controllers\OnlyOfficeController;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::redirect('/', '/organizations');
|
||||
|
||||
Route::middleware(['auth'])->group(function () {
|
||||
Route::get('/organizations', fn () => view('organizations.index'))->name('organizations.index');
|
||||
Route::get('/organizations/create', fn () => view('organizations.create'))->name('organizations.create');
|
||||
Route::get('/organizations/{organization}/edit', fn (Organization $organization) => view('organizations.edit', ['organization' => $organization]))->name('organizations.edit');
|
||||
Route::get('/organizations/{organization}/dashboard', fn (Organization $organization) => view('organizations.dashboard', ['organization' => $organization]))->name('organizations.dashboard');
|
||||
|
||||
Route::prefix('/organizations/{organization}/passwords')->name('organizations.passwords.')->group(function () {
|
||||
Route::get('/', fn (Organization $organization) => view('passwords.index', ['organization' => $organization]))->name('index');
|
||||
Route::get('/create', fn (Organization $organization) => view('passwords.create', ['organization' => $organization]))->name('create');
|
||||
Route::get('/{password}/edit', fn (Organization $organization, Password $password) => view('passwords.edit', [
|
||||
'organization' => $organization,
|
||||
'password' => $password,
|
||||
]))->name('edit');
|
||||
});
|
||||
|
||||
Route::prefix('/organizations/{organization}/locations')->name('organizations.locations.')->group(function () {
|
||||
Route::get('/', fn (Organization $organization) => view('locations.index', ['organization' => $organization]))->name('index');
|
||||
Route::get('/create', fn (Organization $organization) => view('locations.create', ['organization' => $organization]))->name('create');
|
||||
Route::get('/{location}/edit', fn (Organization $organization, Location $location) => view('locations.edit', [
|
||||
'organization' => $organization,
|
||||
'location' => $location,
|
||||
]))->name('edit');
|
||||
});
|
||||
|
||||
Route::prefix('/organizations/{organization}/domains')->name('organizations.domains.')->group(function () {
|
||||
Route::get('/', fn (Organization $organization) => view('domains.index', ['organization' => $organization]))->name('index');
|
||||
Route::get('/create', fn (Organization $organization) => view('domains.create', ['organization' => $organization]))->name('create');
|
||||
Route::get('/{domain}/edit', fn (Organization $organization, Domain $domain) => view('domains.edit', [
|
||||
'organization' => $organization,
|
||||
'domain' => $domain,
|
||||
]))->name('edit');
|
||||
});
|
||||
|
||||
Route::prefix('/organizations/{organization}/contacts')->name('organizations.contacts.')->group(function () {
|
||||
Route::get('/', fn (Organization $organization) => view('contacts.index', ['organization' => $organization]))->name('index');
|
||||
Route::get('/create', fn (Organization $organization) => view('contacts.create', ['organization' => $organization]))->name('create');
|
||||
Route::get('/{contact}/edit', fn (Organization $organization, Contact $contact) => view('contacts.edit', [
|
||||
'organization' => $organization,
|
||||
'contact' => $contact,
|
||||
]))->name('edit');
|
||||
});
|
||||
|
||||
Route::prefix('/organizations/{organization}/documents')->name('organizations.documents.')->group(function () {
|
||||
Route::get('/', fn (Organization $organization) => view('documents.index', ['organization' => $organization]))->name('index');
|
||||
Route::get('/create', fn (Organization $organization, Request $request) => view('documents.create', [
|
||||
'organization' => $organization,
|
||||
'folder' => $request->integer('folder') ?: null,
|
||||
]))->name('create');
|
||||
Route::get('/{document}/edit', fn (Organization $organization, Document $document) => view('documents.edit', [
|
||||
'organization' => $organization,
|
||||
'document' => $document,
|
||||
]))->name('edit');
|
||||
Route::get('/{document}/download', DocumentDownloadController::class)->name('download');
|
||||
});
|
||||
|
||||
Route::prefix('/organizations/{organization}/virtual-machines')->name('organizations.virtual-machines.')->group(function () {
|
||||
Route::get('/', fn (Organization $organization) => view('virtual-machines.index', ['organization' => $organization]))->name('index');
|
||||
Route::get('/create', fn (Organization $organization) => view('virtual-machines.create', ['organization' => $organization]))->name('create');
|
||||
Route::get('/{virtual_machine}/edit', fn (Organization $organization, VirtualMachine $virtual_machine) => view('virtual-machines.edit', [
|
||||
'organization' => $organization,
|
||||
'virtualMachine' => $virtual_machine,
|
||||
]))->name('edit');
|
||||
});
|
||||
|
||||
Route::prefix('/organizations/{organization}/todos')->name('organizations.todos.')->group(function () {
|
||||
Route::get('/', fn (Organization $organization) => view('todos.index', ['organization' => $organization]))->name('index');
|
||||
Route::get('/create', fn (Organization $organization) => view('todos.create', ['organization' => $organization]))->name('create');
|
||||
Route::get('/{todo}/edit', fn (Organization $organization, Todo $todo) => view('todos.edit', [
|
||||
'organization' => $organization,
|
||||
'todo' => $todo,
|
||||
]))->name('edit');
|
||||
});
|
||||
|
||||
Route::prefix('/organizations/{organization}/shortcuts')->name('organizations.shortcuts.')->group(function () {
|
||||
Route::get('/', fn (Organization $organization) => view('shortcuts.index', ['organization' => $organization]))->name('index');
|
||||
Route::get('/create', fn (Organization $organization, Request $request) => view('shortcuts.create', [
|
||||
'organization' => $organization,
|
||||
'global' => $request->boolean('global'),
|
||||
]))->name('create');
|
||||
Route::get('/{shortcut}/edit', fn (Organization $organization, Shortcut $shortcut) => view('shortcuts.edit', [
|
||||
'organization' => $organization,
|
||||
'shortcut' => $shortcut,
|
||||
]))->name('edit');
|
||||
});
|
||||
|
||||
Route::prefix('/users')->name('users.')->middleware('role:Administrateur')->group(function () {
|
||||
Route::get('/', fn () => view('users.index'))->name('index');
|
||||
Route::get('/create', fn () => view('users.create'))->name('create');
|
||||
Route::get('/{user}/edit', fn (User $user) => view('users.edit', ['user' => $user]))->name('edit');
|
||||
});
|
||||
|
||||
Route::prefix('/asset-types')->name('asset-types.')->middleware('role:Administrateur')->group(function () {
|
||||
Route::get('/', fn () => view('asset-types.index'))->name('index');
|
||||
Route::get('/create', fn () => view('asset-types.create'))->name('create');
|
||||
Route::get('/{type}/edit', fn (FlexibleAssetType $type) => view('asset-types.edit', ['type' => $type]))->name('edit');
|
||||
});
|
||||
|
||||
Route::get('/organizations/{organization}/assets', function (Organization $organization) {
|
||||
return view('assets.picker', [
|
||||
'organization' => $organization,
|
||||
'types' => FlexibleAssetType::orderBy('name')->get(),
|
||||
]);
|
||||
})->name('organizations.assets.picker');
|
||||
|
||||
Route::prefix('/organizations/{organization}/asset-types/{type}/assets')->name('organizations.assets.')->group(function () {
|
||||
Route::get('/', fn (Organization $organization, FlexibleAssetType $type) => view('assets.index', [
|
||||
'organization' => $organization,
|
||||
'type' => $type,
|
||||
]))->name('index');
|
||||
Route::get('/create', fn (Organization $organization, FlexibleAssetType $type) => view('assets.create', [
|
||||
'organization' => $organization,
|
||||
'type' => $type,
|
||||
]))->name('create');
|
||||
Route::get('/{asset}/edit', fn (Organization $organization, FlexibleAssetType $type, FlexibleAsset $asset) => view('assets.edit', [
|
||||
'organization' => $organization,
|
||||
'type' => $type,
|
||||
'asset' => $asset,
|
||||
]))->name('edit');
|
||||
});
|
||||
});
|
||||
|
||||
// OnlyOffice Document Server calls these server-to-server (no user session):
|
||||
// download uses a signed URL, callback is authenticated via JWT bearer token.
|
||||
Route::prefix('/onlyoffice/documents/{document}')->name('onlyoffice.')->group(function () {
|
||||
Route::get('/download', [OnlyOfficeController::class, 'download'])->name('download');
|
||||
Route::post('/callback', [OnlyOfficeController::class, 'callback'])->name('callback');
|
||||
});
|
||||
Reference in New Issue
Block a user