@extends('layouts.app') @section('css') @endsection @section('js') @endsection @push('pageTitle') {{ isset($companyRecommendation) && isset($readonly) && $readonly ? __('labels.company_recommendation') : (isset($companyRecommendation) ? __('labels.edit_company_recommendation') : __('labels.create_company_recommendation')) }} @endpush @section('content') @include('components.common.page-header', [ 'pageTitle' => isset($companyRecommendation) && isset($readonly) && $readonly ? __('labels.company_recommendation') : (isset($companyRecommendation) ? __('labels.edit_company_recommendation') : __('labels.create_company_recommendation')), 'actionButton' => [ 'url' => route('company-recommendations.index', ['type' => 'latest']), 'text' => __('labels.back_to_list'), ], ]) @include('components.common.flush-message') @include('components.common.validation-errors') @include('components.form.add-category-modal')
@csrf @if (isset($companyRecommendation)) @method('PUT') @endif
{{-- Title --}}
@error('title')
{{ $message }}
@enderror
{{-- Description --}}
@error('description')
{{ $message }}
@enderror
@include('components.form.author-name', [ 'readonly' => isset($readonly) && $readonly ? 1 : 0, 'authorName' => old('author_name', isset($companyRecommendation->author_name) && $companyRecommendation->author_name ? $companyRecommendation->author_name : auth()->user()->name), ]) @include('components.form.select2-with-add-button',[ 'name' => 'category_id', 'categoryList' => $categories, 'selectedValue' => $companyRecommendation->category_id ?? null, 'required' => true, 'canCreate' => Auth::user()->can('create', \App\Models\CompanyRecommendation::class), 'createUrl' => route('company-recommendation-categories.store'), ]) @if (auth()->user()->isAdmin() || auth()->user()->isGroupAdmin())
@error('audience')
{{ $message }}
@enderror
@endif @include('components.form.published-inputs', [ 'readonly' => isset($readonly) && $readonly ? 1 : 0, 'published_at' => old('published_at', $companyRecommendation->published_at ?? ''), 'is_published' => old('is_published', $companyRecommendation->is_published ?? ''), ])
{{-- File Manager --}} @isset($companyRecommendation->assets) @include('components.form.file-manager.existing-files', [ 'readonly' => isset($readonly) && $readonly, 'assets' => $companyRecommendation->assets, ]) @endisset @if (!isset($readonly) || !$readonly) @include('components.form.file-manager.upload-files') @endif {{-- Groups --}} @include('components.form.select-group', [ 'readonly' => isset($readonly) && $readonly, 'groups' => $groups ?? [], 'selectedGroups' => old('groups', $selectedGroups ?? null), 'canCreate' => auth()->user()->can('create', \App\Models\CompanyRecommendation::class), 'canUpdate' => isset($companyRecommendation) && auth()->user()->can('update', $companyRecommendation), ]) @if (!isset($readonly) || !$readonly)
{{ __('labels.cancel') }}
@endif
@endsection