From 48d329e50352d37e1335dd8efcacee33059c22e9 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 23 Oct 2024 22:08:57 +1100 Subject: [PATCH] List files in a file area --- app/Models/Filearea.php | 5 ++ resources/views/filearea/addedit.blade.php | 58 +++++++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/app/Models/Filearea.php b/app/Models/Filearea.php index 68bac9d..c291eec 100644 --- a/app/Models/Filearea.php +++ b/app/Models/Filearea.php @@ -31,4 +31,9 @@ class Filearea extends Model { return $this->belongsTo(Domain::class); } + + public function files() + { + return $this->hasMany(File::class); + } } \ No newline at end of file diff --git a/resources/views/filearea/addedit.blade.php b/resources/views/filearea/addedit.blade.php index 29335c4..7318e3d 100644 --- a/resources/views/filearea/addedit.blade.php +++ b/resources/views/filearea/addedit.blade.php @@ -150,5 +150,61 @@ + +
+
+ @if ($o->files->count()) + + + + + + + + + + + + + @foreach ($o->files as $oo) + + + + + + + + @endforeach + +
IDFileSizeHatchedDescription
{{ $oo->id }}{{ $oo->name }}{{ number_format($oo->size) }}{{ $oo->datetime->format('Y-m-d H:i:s') }}{{ $oo->desc }}
+ @else +

No files yet in this area.

+ @endif +
+
-@endsection \ No newline at end of file +@endsection + +@section('page-css') + @css('datatables') +@append + +@section('page-scripts') + @js('datatables') + + +@append \ No newline at end of file