@php use Carbon\Carbon; $edit = !empty($notice->id); @endphp @extends('layouts.admin.master') @section('title') {{ $edit ? 'Edit' : 'Create' }} Notice @endsection @section('content')

{{ $edit ? 'Edit' : 'Create' }} Notices

Back
@csrf @if ($edit) @method('PUT') @endif
@if ($edit && $notice->attachment)
@php $extension = strtolower(pathinfo($notice->attachment, PATHINFO_EXTENSION)); $isImage = in_array($extension, ['jpg', 'jpeg', 'png', 'gif', 'webp']); @endphp @if($isImage) Preview @else
@switch($extension) @case('pdf') @break @case('doc') @case('docx') @break @case('xls') @case('xlsx') @break @default @endswitch
@endif {{-- {{ basename($notice->attachment) }} --}}
@endif
@endsection @push('css') @endpush @push('js') @endpush