PHP Classes

Laravel Upload File Manager: Manage the upload of public and private files

Recommend this page to a friend!
  Info   View files Documentation   View files View files (13)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 105 This week: 1All time: 9,696 This week: 560Up
Version License PHP version Categories
laravel-uploader 1.0.0Custom (specified...5HTTP, PHP 5, Files and Folders
Description 

Author

This package can manage the upload of public and private files.

It can handle file uploads by storing the files in local directory or a remote directory in Amazon S3.

The package can also associate file ownership to a given Laravel application user, with the possibility to restrict the access until a given date, as well forbid certain user to access a given file.

Innovation Award
PHP Programming Innovation award nominee
May 2020
Number 8
Many sites need to allow users to upload files to be shared with other users either publicly or privately.

Access control may also need to be personalized, so only a set of users may access those uploaded files.

This package provides a solution, that can not only restrict the access of files to certain users, but can also restrict the period of time that the files remain accessible until a specific date.

Manuel Lemos
Picture of Moamen Eltouny
  Performance   Level  
Name: Moamen Eltouny <contact>
Classes: 36 packages by
Country: Egypt Egypt
Age: 31
All time rank: 259926 in Egypt Egypt
Week rank: 52 Up1 in Egypt Egypt Up
Innovation award
Innovation award
Nominee: 20x

Documentation

[RaggiTech] Laravel >= 6.0 - Uploader.

Latest Stable Version Total Downloads License

Laravel Uploader provides a quick and easy methods to upload files and handling visibility with simple routing.

Install

Install the latest version using Composer:

$ composer require raggitech/laravel-uploader

then publish the migration & config files

$ php artisan vendor:publish --tag=laravel-uploader
$ php artisan migrate

Usage

<a name="config"></a>

Configurations / Options

/
*	prefix 		=> Hash Prefix
*	visitable	=> Visits Counter
*	private		=> Only Permitted Users
*/

<a name="UG"></a>

Uploading & Getting

function upload(UploadedFile $file, array $options = [])
function getUpload(string $hash)

// Upload File
$file = upload($request->image, [
	'visitable'	=> true
]);

// Getting Uploaded File with Hash code
$file = getUploaded('5e63885fa771d1.12185481920ncF3...');

// Information
echo $file->hash; // File's Hash
echo $file->name; // File's Name
echo $file->path; // File's Path
echo $file->size; // File's Size in Bytes
echo $file->readableSize(); // File's Readable Size
echo $file->extension; // File's Extension
echo $file->mime; // File's MIME

echo $file->visits; // File's visits (Visitable File)

<a name="URL_UP"></a>

URL & Uploader

echo $file->url(); // Getting Uploaded File's URL
// <img src"{{ $file->url() }}" alt="{{ $file->name }}">

$user = $file->uploader; // Getting Uploader's Model

<a name="dd"></a>

Deleting Uploaded File

$file->delete();

<a name="permits"></a>

Permits (Private File)

$permits = $file->permits; // Getting Permits List
$permitted = $file->isPermitted($user); // Checking if permitted (App\User)

$file->permit($user, '2021-02-01'); // Permitting a user
$file->forbid($user); // Forbidding a user

License

MIT license


  Files folder image Files  
File Role Description
Files folder imagesrc (6 files, 3 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imageconfig (1 file)
Files folder imageController (1 file)
Files folder imagedatabase (1 directory)
  Plain text file File.php Class Class source
  Accessible without login Plain text file Helpers.php Example Example script
  Plain text file routes.php Class Class source
  Plain text file Upload.php Class Class source
  Plain text file UploaderServiceProvider.php Class Class source
  Plain text file UploadPermit.php Class Class source

  Files folder image Files  /  src  /  config  
File Role Description
  Accessible without login Plain text file uploader.php Conf. Configuration script

  Files folder image Files  /  src  /  Controller  
File Role Description
  Plain text file UploadController.php Class Class source

  Files folder image Files  /  src  /  database  
File Role Description
Files folder imagemigrations (2 files)

  Files folder image Files  /  src  /  database  /  migrations  
File Role Description
  Plain text file uploads.stub Class Class source
  Plain text file upload_permits.stub Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:105
This week:1
All time:9,696
This week:560Up