@extends('layouts.app') @php $isEdit = isset($document); $selectedScope = old('access_scope', $document->access_scope ?? 'global'); $selectedRegions = old('region_ids', $isEdit ? $document->regions->pluck('id')->all() : []); $selectedCountries = old('country_ids', $isEdit ? $document->countries->pluck('id')->all() : []); $selectedOems = old('oem_ids', $isEdit ? $document->oems->pluck('id')->all() : []); $selectedUsers = old('user_ids', $isEdit ? $document->users->pluck('id')->all() : []); @endphp @section('title', ($isEdit ? 'Edit' : 'Upload') . ' document · DocShare') @section('section', 'Document workspace') @section('subtitle', $isEdit ? 'Update metadata, permissions, and lifecycle settings.' : 'Add a protected document to your library with the right controls.') @section('content')
← Back to documents
{{ $isEdit ? 'Edit document' : 'New document' }}

{{ $isEdit ? 'Refine document settings' : 'Add a document' }}

{{ $isEdit ? 'Keep document information, access rules, and publishing dates accurate.' : 'Upload once, then control exactly who can see, print, or download it.' }}

All changes are protected
@if($errors->any()) @endif
@csrf @if($isEdit) @method('put') @endif
@if(!$isEdit)
01

Upload protected file

PDF, Word, or Excel files up to 100 MB.

@else

Current protected file

{{ $document->currentVersion?->original_filename ?? 'File unavailable' }}

Version {{ $document->currentVersion?->version ?? '—' }} · {{ $document->currentVersion?->file_size ? number_format($document->currentVersion->file_size / 1048576, 2).' MB' : 'Size unavailable' }}

To replace the file, save changes first and upload a new version from the document list.

@endif
{{ $isEdit ? '01' : '02' }}

Document information

Use clear identifiers so your team can find this document quickly.

{{ $isEdit ? '02' : '03' }}

Access scope

Choose who should be able to discover this document.

@foreach([['global','Everyone','All active users can access it.'],['region','Regions','Limit by business region.'],['country','Countries','Limit to selected countries.'],['oem','OEMs','Share with OEM partners.'],['users','Specific users','Choose individual accounts.']] as [$scope,$label,$desc]) @endforeach
Global access: no additional audience selection is required.
@foreach([['region_ids','Regions','region',$regions,$selectedRegions],['country_ids','Countries','country',$countries,$selectedCountries],['oem_ids','OEMs','oem',$oems,$selectedOems],['user_ids','Users','users',$users,$selectedUsers]] as [$name,$label,$scope,$items,$selected]) @endforeach
{{ $isEdit ? '03' : '04' }}

Permissions & lifecycle

Set customer actions and automate document availability.

Customer permissions

@foreach(['can_view'=>'View','can_print'=>'Print','can_download'=>'Download'] as $permName=>$permLabel) @endforeach
Cancel
@endsection @push('head') @endpush @push('scripts') @endpush