Download the PHP package rootinc/laravel-s3-file-model without Composer

On this page you can find all versions of the php package rootinc/laravel-s3-file-model. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-s3-file-model

Laravel S3 File Model

Provides a File Model that supports direct uploads / downloads from S3 for a Laravel App.

Installation

  1. composer require rootinc/laravel-s3-file-model
  2. Run php artisan vendor:publish --provider="RootInc\LaravelS3FileModel\FileModelServiceProvider" to create File model in app, FileTest in tests\Unit, FileFactory in database\factories, 2020_03_12_152841_create_files_table in database\migrations, and FileController in app\Http\Controllers
  3. Run php artisan vendor:publish --provider="Aws\Laravel\AwsServiceProvider which adds aws.php in the config folder
  4. In the aws.php file, change 'region' => env('AWS_REGION', 'us-east-1'), to use AWS_DEFAULT_REGION
  5. In config\filesystems.php, add key 'directory' => '', // root dir to public and add key 'directory' => env('AWS_UPLOAD_FOLDER'), to s3
  6. In tests\TestCase, add this function:

  7. Update routing. We can use this as an example: Route::apiResource('files', 'FileController')->only(['index', 'store', 'update', 'destroy']);
  8. :tada:

Update from 0.1. to 0.2.

If we are using API versioning paradigm, 0.2.* lets us abstract the file model so that in a child class, we can import a different version of the File.

For example, our FileController would look something like this:

Now when running the parent's functionality, it will make use of the right model.

Note -- the FileController's update and delete methods have been switched from public function method(Request $request, File $file) to public function method(Request $request, $file_id)

The same has been updated for tests. That way, if we want to make use of Laravel 8's updated factory classes, we can do so like below:

Example React FileUploader

Contributing

Thank you for considering contributing to the Laravel S3 File Model! To encourage active collaboration, we encourage pull requests, not just issues.

If you file an issue, the issue should contain a title and a clear description of the issue. You should also include as much relevant information as possible and a code sample that demonstrates the issue. The goal of a issue is to make it easy for yourself - and others - to replicate the bug and develop a fix.

License

The Laravel S3 File Model is open-sourced software licensed under the MIT license.


All versions of laravel-s3-file-model with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.2
laravel/framework Version >=9
maltyxx/images-generator Version ^1
aws/aws-sdk-php-laravel Version ^3
league/flysystem-aws-s3-v3 Version ^3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rootinc/laravel-s3-file-model contains the following files

Loading the files please wait ....