@extends('layout.layout') @section('content')
{{-- Alerts --}} @include('components.alert')
Scripts
{{-- Export Button --}} Export @can('marketing_scripts_create') Add New Script @endcan
{{-- Filtering Section --}}
{{-- Search by title or description --}}
{{-- Filter by Department --}} @if(Auth::user()->hasRole('Super admin') || Auth::user()->staff->department->slug == 'marketing')
@endif {{-- Filter by Visibility --}} @if(Auth::user()->hasRole('Super admin') || Auth::user()->staff->department->slug == 'marketing')
@endif {{-- Clear Filters --}} @if (request()->filled('search') || request()->filled('visibility') || request()->filled('department_id') || request()->filled('status') ) @endif
{{-- Table --}} @if ($scripts->isNotEmpty())
@foreach ($scripts as $scr) @endforeach
ID Title Category Status Visibility Created On Action
{{ $scr->id }} {{ $scr->title }} {{ $scr->category_name }} @php $statusColors = [ 'approved' => 'success', 'unapproved' => 'danger' ]; $statusIcons = [ 'approved' => 'fa-solid fa-circle-check', 'unapproved' => 'fa-solid fa-circle-xmark' ]; @endphp {{ ucfirst($scr->status) }} @php $visibilityColors = [ 'public' => 'success', 'private' => 'secondary' ]; $visibilityIcons = [ 'public' => 'fa-globe', 'private' => 'fa-lock' ]; @endphp {{ ucfirst($scr->visibility) }} {{ \Carbon\Carbon::parse($scr->created_at)->format('d M Y') }} @can('marketing_scripts_show') View @endcan @can('marketing_scripts_edit') Edit @endcan
{{-- Pagination --}}
{{ $scripts->withQueryString()->links() }}
@else {{-- Empty case --}}

No scripts found matching the criteria.

@can('marketing_scripts_create') Add First Script @endcan
@endif
@endsection