PitchHut
Log in / Sign up
laravel-sql-storage
79 views
Effortlessly store files in MySQL with Laravel.
Pitch

Laravel SQL Storage allows you to efficiently manage large files by using MySQL as your storage driver. Streamlining the storage process for applications handling millions of files, this package simplifies your file management while integrating seamlessly with Laravel's existing storage structure.

Description

Effortlessly leverage MySQL as a storage driver for your Laravel application with Laravel SQL Storage. Designed to handle the storage of over 10 million files linked to more than 1 million identifiers, this package offers a streamlined solution that outmatches traditional NFS systems, making your file management easier and more efficient.

Key Features:

  • Integrative Storage Solution: Utilize MySQL databases for file storage, eliminating the complexities associated with NFS.

  • UUID-Based Organization: Each file is associated with a unique UUID, akin to a root folder, making file retrieval straightforward and organized.

  • Simple Migration Setup: With a couple of commands, create the necessary database tables to get started:

    php artisan migrate  
    
  • Practical Usage Examples:

// Initialize the storage using a unique UUID
$uuid = 'a3b04866-99b4-4edd-a85f-b12727bdd2ca';
$s = Storage::disk('database')->usingUuid($uuid);

// Manage files easily
$filename = "this.is.fake.txt";
$contents = str_repeat(str_repeat("a", 100) . str_repeat("b", 100), 100);
$s->put($filename, $contents);

// Verification and output
if ($s->exists($filename)) {
print "Size is " . $s->size($filename) . "\n";
$m = $s->getModel($filename);
print "Model is: " . json_encode($m) . "\n";
$s->delete($filename);
} else {
print "$filename does not exist?\n";
}


The **Laravel SQL Storage** package is perfect for Laravel developers in search of a robust and efficient file storage solution, particularly when dealing with large-scale data requirements. Explore the endless possibilities of organizing and retrieving your data seamlessly with this invaluable tool.