PHPackages                             baki/gallery - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. baki/gallery

ActivePackage[File &amp; Storage](/categories/file-storage)

baki/gallery
============

Store gallery

039PHP

Since Sep 29Pushed 5y agoCompare

[ Source](https://github.com/BojanDjurdjevic995/gallery)[ Packagist](https://packagist.org/packages/baki/gallery)[ RSS](/packages/baki-gallery/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Instruction
===========

[](#instruction)

Require this package with composer:

```
composer require baki/gallery

```

To use gallery package, use this in your controller

```
use StoreGallery;

```

After that, create your disk in config/filesystems.php

```
'yourDisk' => [
            'driver' => 'local',
            'root' => storage_path('app/public/your-directory'),
            'url' => env('APP_URL').'/your-directory',
            'visibility' => 'public',
        ],

```

In your table you must have column 'image' and column for your id of news or post. Like this:

```
public function up()
{
    Schema::create('galleries', function (Blueprint $table) {
        $table->increments('id');
        $table->unsignedInteger('id_news'); // In my case this is foreign key from table news. This is ID of my news
        $table->string('image')->nullable();
        $table->timestamps();
    });
}

```

In method you use my package for store gallery like this:

```
StoreGallery::store('App\YourModel', 'input_name', 'yourDisk', 'id_of_your_post_or_news', 'column_in_database', false, width, height);

```

Example for store gallery:
==========================

[](#example-for-store-gallery)

```
public function store(Request $r)
{
    $news               = new News;
    $news->title        = strip_tags($r->title);
    $news->content      = strip_tags($r->content);
    $news->save();

    // It is without crop image
    StoreGallery::store('App\Gallery', 'gallery', 'galleryNews',  $input->id, 'id_news');

    // It is with crop image
    StoreGallery::store('App\Gallery', 'gallery', 'galleryNews',  $input->id, 'id_news', false, 840, 420);

    return redirect()->route('news.index');
}

```

Example for update gallery:
===========================

[](#example-for-update-gallery)

```
public function update(Request $r, News $news)
{
    $news->title = $r->title;
    $news->content = $r->content;
    $news->save();

    // It is without crop image
    StoreGallery::store('App\Gallery', 'gallery', 'galleryNews',  $input->id, 'id_news', true); // Old gallery will be deleted

    // It is with crop image
    StoreGallery::store('App\Gallery', 'gallery', 'galleryNews',  $input->id, 'id_news', true, 840, 420); // Old gallery will be deleted

    return redirect()->route('news.index');
}

```

For delete gallery use this code:

```
StoreGallery::delete('App\YourModel', $id_news_or_post, 'column_in_database', 'yourDisk');

```

Example for delete gallery and news
===================================

[](#example-for-delete-gallery-and-news)

```
public function destroy(News $news)
{
    StoreGallery::delete('App\Gallery', $news->id, 'id_news', 'galleryNews');
    $news->delete();

    return redirect()->route('news.index');
}

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 91.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e893ad5d688f522745b4def59edf658bc65d19cdbb8094911da476acd1268b1?d=identicon)[baki1995](/maintainers/baki1995)

---

Top Contributors

[![BojanDjurdjevic995](https://avatars.githubusercontent.com/u/47319947?v=4)](https://github.com/BojanDjurdjevic995 "BojanDjurdjevic995 (43 commits)")[![Baki995](https://avatars.githubusercontent.com/u/118567196?v=4)](https://github.com/Baki995 "Baki995 (4 commits)")

### Embed Badge

![Health badge](/badges/baki-gallery/health.svg)

```
[![Health](https://phpackages.com/badges/baki-gallery/health.svg)](https://phpackages.com/packages/baki-gallery)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
