Skip to main content

DashboardController

The main admin dashboard controller that displays the admin panel home page. Namespace: App\Http\Controllers\Admin\DashboardController

dashboard()

Display the admin dashboard home page. Route: GET /admin (admin.dashboard) Middleware: auth, verified, permission:access.admin.panel Returns: View - Admin dashboard view Example:
return view('admin.dashboard');
Source: Admin/DashboardController.php:10

AlbumController

Handles album management operations in the admin panel. Namespace: App\Http\Controllers\Admin\AlbumController Routes: Resource controller under admin/gallery/albums prefix

index()

Display a listing of all photo albums with their cover photos and photo counts. Route: GET /admin/gallery/albums (admin.gallery.albums.index) Returns: View - Admin albums listing page Example:
$albums = Album::with('cover_photo')
    ->withCount('photos')
    ->latest()
    ->get();

return view('admin.gallery.albums', compact('albums'));
Query Details:
  • Eager loads the cover_photo relationship
  • Includes a count of photos in each album
  • Ordered by creation date (newest first)
Source: Admin/AlbumController.php:14

create()

Show the form for creating a new album. Route: GET /admin/gallery/albums/create (admin.gallery.albums.create) Status: Not yet implemented Source: Admin/AlbumController.php:27

store()

Store a newly created album in storage. Route: POST /admin/gallery/albums (admin.gallery.albums.store)
request
Request
required
HTTP request containing album data
Status: Not yet implemented Source: Admin/AlbumController.php:35

show()

Display a specific album. Route: GET /admin/gallery/albums/{id} (admin.gallery.albums.show)
id
string
required
The album ID
Status: Not yet implemented Source: Admin/AlbumController.php:43

edit()

Show the form for editing a specific album. Route: GET /admin/gallery/albums/{id}/edit (admin.gallery.albums.edit)
id
string
required
The album ID
Status: Not yet implemented Source: Admin/AlbumController.php:51

update()

Update a specific album in storage. Route: PUT/PATCH /admin/gallery/albums/{id} (admin.gallery.albums.update)
request
Request
required
HTTP request containing updated album data
id
string
required
The album ID
Status: Not yet implemented Source: Admin/AlbumController.php:59

destroy()

Remove a specific album from storage. Route: DELETE /admin/gallery/albums/{id} (admin.gallery.albums.destroy)
id
string
required
The album ID
Status: Not yet implemented Source: Admin/AlbumController.php:67

PhotoController

Handles photo management operations in the admin panel with full CRUD functionality. Namespace: App\Http\Controllers\Admin\PhotoController Routes: Resource controller under admin/gallery/photos prefix

index()

Display a listing of all photos with their media attachments. Route: GET /admin/gallery/photos (admin.gallery.photos.index) Returns: View - Admin photos listing page Example:
$photos = Photo::with('media')->get();
return view('admin.gallery.photos', compact('photos'));
Source: Admin/PhotoController.php:15

create()

Show the form for creating a new photo. Route: GET /admin/gallery/photos/create (admin.gallery.photos.create) Returns: View - Photo creation form Example:
return view('admin.gallery.photo.create');
Source: Admin/PhotoController.php:24

store()

Store a newly created photo in storage. Route: POST /admin/gallery/photos (admin.gallery.photos.store)
request
StorePhotoRequest
required
Form request with validated photo data
Returns: RedirectResponse - Redirects to photos index with success message Example:
$photo = Photo::create($request->validated());
return redirect()
    ->route('admin.gallery.photos.index')
    ->with('success', 'Photo created successfully.');
Note: The StorePhotoRequest validation rules are currently empty and need to be implemented. Source: Admin/PhotoController.php:32

show()

Display a specific photo. Route: GET /admin/gallery/photos/{photo} (admin.gallery.photos.show)
photo
Photo
required
Photo instance (route model binding)
Returns: View - Photo detail page Example:
return view('admin.gallery.photo.show', compact('photo'));
Source: Admin/PhotoController.php:42

edit()

Show the form for editing a specific photo. Route: GET /admin/gallery/photos/{photo}/edit (admin.gallery.photos.edit)
photo
Photo
required
Photo instance (route model binding)
Returns: View - Photo edit form Example:
return view('admin.gallery.photo.edit', compact('photo'));
Source: Admin/PhotoController.php:50

update()

Update a specific photo in storage. Route: PUT/PATCH /admin/gallery/photos/{photo} (admin.gallery.photos.update)
request
UpdatePhotoRequest
required
Form request with validated photo data
photo
Photo
required
Photo instance to update (route model binding)
Returns: RedirectResponse - Redirects to photos index with success message Example:
$photo->update($request->validated());
return redirect()
    ->route('admin.gallery.photos.index')
    ->with('success', 'Photo updated successfully.');
Note: The UpdatePhotoRequest validation rules are currently empty and need to be implemented. Source: Admin/PhotoController.php:58

destroy()

Remove a specific photo from storage. Route: DELETE /admin/gallery/photos/{photo} (admin.gallery.photos.destroy)
photo
Photo
required
Photo instance to delete (route model binding)
Returns: RedirectResponse - Redirects to photos index with success message Example:
$photo->delete();
return redirect()
    ->route('admin.gallery.photos.index')
    ->with('success', 'Photo deleted successfully.');
Source: Admin/PhotoController.php:68

GalleryController (Admin)

Alternative admin gallery controller with simplified album and photo views. Namespace: App\Http\Controllers\Admin\GalleryController Note: This controller appears to be an alternative to the resource controllers above.

Albums()

Display all albums with cover photos and photo counts. Returns: View - Admin gallery albums page Example:
$albums = Album::with('cover_photo')
    ->withCount('photos')
    ->latest()
    ->get();

return view('admin.gallery.album', compact('albums'));
Source: Admin/GalleryController.php:12

Photos()

Display all photos with their media attachments. Returns: View - Admin gallery photos page Example:
$photos = Photo::with('media')->get();
return view('admin.gallery.photo', compact('photos'));
Source: Admin/GalleryController.php:22

URLShortener

Manages the URL shortener tool in the admin panel. Namespace: App\Http\Controllers\Admin\URLShortener

index()

Display the URL shortener management page. Route: GET /admin/url-shortener (admin.url.short) Middleware: auth, verified, permission:access.admin.panel Returns: View - URL shortener admin page Example:
return view('admin.url-short');
Source: Admin/URLShortener.php:13

URLRedirect

Manages URL redirects in the admin panel. Namespace: App\Http\Controllers\Admin\URLRedirect

index()

Display the URL redirect management page. Route: GET /admin/url-redirect (admin.url.redirect) Middleware: auth, verified, permission:access.admin.panel Returns: View - URL redirect admin page Example:
return view('admin.url-redirect');
Source: Admin/URLRedirect.php:13

Middleware

All admin controllers are protected by the following middleware:
  • auth - Requires authenticated user
  • verified - Requires email verification
  • permission:access.admin.panel - Requires admin panel access permission

Route Grouping

All admin routes are grouped under the /admin prefix with the admin. name prefix:
Route::prefix('admin')
    ->name('admin.')
    ->middleware('auth', 'verified', 'permission:access.admin.panel')
    ->group(function () {
        // All admin routes
    });

Build docs developers (and LLMs) love