@extends('admin.layout.layout') @section('content')

{{ $post ? 'Edit post' : 'Add post' }}

@if ($message = Session::get('success')) @endif @if (Session::has('error')) @endif
@csrf @if ($post) @method('PUT') @endif
@error('title')
{{ $message }}
@enderror
@error('description')
{{ $message }}
@enderror
@if ($post && $post->media->count() > 0)
@foreach ($post->media as $media)
@if ($media->media_type == 'image') image @elseif ($media->media_type == 'video') @elseif ($media->media_type == 'audio') @elseif ($media->media_type == 'doc') {{ $media->media_url }} @endif Remove
@endforeach
@endif
@error('media')
{{ $message }}
@enderror
@endsection