@extends('layouts.master') @section('title') @lang('Title') @endsection @section('css') @endsection @section('content')

Product

Product
@if ($message = Session::has('success'))
{{ $message }}
@endif
@method('PUT') {{ csrf_field() }} @if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@if ($errors->has('title'))
{{ $errors->first('title') }}
@endif
@if ($errors->has('summary'))
{{ $errors->first('summary') }}
@endif
@if ($errors->has('description'))
{{ $errors->first('description') }}
@endif
@if ($errors->has('status'))
{{ $errors->first('status') }}
@endif
@php // $file_array=array(); $fileData = []; // Initialize as an array before appending foreach($product->galleries as $gallery){ // $file_array[]=$gallery->filename; if (Storage::disk('public')->exists('uploads/gallery/' . $gallery->filename)) { $fileData[] = [ 'file_name' => $gallery->filename, 'file_size' => Storage::disk('public')->size('uploads/gallery/' . $gallery->filename), 'file_url' => asset('storage/uploads/gallery/' . $gallery->filename) ]; } else { // Handle missing file case Log::error('File not found: ' . $gallery->filename); } } // $fileName = json_encode($file_array); @endphp
@endsection @section('script') @endsection