Letting students upload materials without turning the library into a junk drawer or exposing the server file layout.
constraint: All listings, search and download endpoints must respect an is_approved gate. File paths and original filenames are stored separately so the public URL never leaks the on-disk layout.
Resource has is_approved (default false), file_path (server-side, opaque) and file_name (display only). Every Livewire list/search scope adds where('is_approved', true). The upload flow notifies coordinators, who can approve in one click. Search across title/description/subject uses a single Livewire-debounced query.
public function render()
{
$resources = Resource::with('user')
->where('is_approved', true)
->when($this->search, function ($query) {
$query->where(function ($q) {
$q->where('title', 'like', '%' . $this->search . '%')
->orWhere('description','like', '%' . $this->search . '%')
->orWhere('subject', 'like', '%' . $this->search . '%');
});
})
->latest()
->paginate(20);
return view('livewire.resources.resource-list', compact('resources'));
}