TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/OswalSnow/AR-Barber/llms.txt
Use this file to discover all available pages before exploring further.
PortfolioImage model tracks uploaded photos of barber work. Each record holds a relative file path on the public storage disk. Images are displayed in reverse-chronological order in the Nuevos Cortes tab on the public homepage. Deletion removes both the database record and the physical file from storage.
Fields
Auto-incrementing primary key.
Relative path to the image file on the
public storage disk. The path is stored without a leading slash and follows the pattern portfolio/filename.jpg. To build a publicly accessible URL, pass the path to asset() with the storage/ prefix:Timestamp set automatically when the record is created. Used as the sort key when retrieving images for display.
Timestamp updated automatically on every save.
Retrieving images for display
Images are fetched in reverse-chronological order (newest first) for the portfolio gallery:asset():
Uploading images
When a new photo is uploaded, store the file on thepublic disk under the portfolio/ directory and record the returned path:
Deleting images
Deleting aPortfolioImage record must also remove the physical file from disk. The application handles this explicitly using Storage::disk('public')->delete():
Calling
$image->delete() alone only removes the database record. The file on disk remains and will accumulate as orphaned storage. Always pair the two operations when removing a portfolio image.Storage link requirement
Thepublic disk serves files from storage/app/public/. For these files to be accessible via a browser URL, a symbolic link must exist at public/storage pointing to that directory.
Run this once after deploying or cloning the project:
asset('storage/...') URLs will return 404 responses even though the files exist on disk.