lisa-fehr/gallery

Gallery package for existing site

3.0 2023-08-22 20:30 UTC

This package is auto-updated.

Last update: 2024-05-19 07:43:56 UTC


README

Packaged version of the recreate gallery project

Screen Shot 2024-05-19 at 3 41 36 AM

Run:

composer require lisa-fehr/gallery

php artisan storage:link

php artisan gallery:install

php artisan images:generate

npm run development

Add the css and js files to your layout file:

<link rel="stylesheet" href="{{ asset('vendor/lisa-fehr/gallery/css/app.css') }}" type="text/css" media="screen"/>
...
<script src="{{mix('js/app.js', 'vendor/lisa-fehr/gallery')}}"></script>

Add this div to a view called portfolio:

<div id="gallery-app" class="text-sm w-full" data-filters="{{$filter['tags'] ?? ''}}"></div>

You can also override routes with inconsistent patterns:

{
    "tag": "path from root - no starting slash needed"
}
<div id="gallery-app" class="text-sm w-full" 
    data-filters="{{$filter['tags'] ?? ''}}"
    data-routes='{"portfolio":"portfolio","Folder2005":"Folder\/2005"}'
></div>

Add to routes file

Add this kind of code to routes, where tags match the uber_tags table (route name is required to match the tag):

Route::get('photos', function () {

return view('portfolio')->with('filter', ['tags' => 'California,California2005,California2009,California2014']);

})->name('photos');

Or use the Tag model to get all the children:

Route::get('California', function () {
    $children = UberTags::where('name', 'california')->allChildren()->pluck('name')->implode(',');
    return view('portfolio')->with('filter', ['tags' => 'california,' . $children]);
})->name('California');

If the named route for the tag doesn't exist, it will not show up in navigation to prevent broken links.