All Projects → kenarkose → Transit

kenarkose / Transit

Licence: mit
Easy file uploading and downloading for Laravel 5.

Projects that are alternatives of or similar to Transit

speed-cloudflare-cli
📈 Measure the speed and consistency of your internet connection using speed.cloudflare.com
Stars: ✭ 99 (+1880%)
Mutual labels:  download, upload
UniBorg
Pluggable Telegram bot and userbot based on Telethon
Stars: ✭ 196 (+3820%)
Mutual labels:  download, upload
simple http server
simple http server for upload and download
Stars: ✭ 101 (+1920%)
Mutual labels:  download, upload
Backdoor
A backdoor that runs on Linux and Windows
Stars: ✭ 36 (+620%)
Mutual labels:  download, upload
Rx Mvp
RxJava2+Retrofit2+RxLifecycle2+OkHttp3 封装RHttp 使用MVP模式构建项目
Stars: ✭ 343 (+6760%)
Mutual labels:  download, upload
ZDrive
Seamless download/upload contents via Google Drive 📂
Stars: ✭ 25 (+400%)
Mutual labels:  download, upload
PyroGramBot
pluggable Telegram Bot based on Pyrogram
Stars: ✭ 168 (+3260%)
Mutual labels:  download, upload
Laravel Filemanager
Media gallery with CKEditor, TinyMCE and Summernote support. Built on Laravel file system.
Stars: ✭ 1,688 (+33660%)
Mutual labels:  laravel, upload
Invoices
Generate PDF invoices for your customers in laravel
Stars: ✭ 298 (+5860%)
Mutual labels:  laravel, download
Godfs
A simple fast, easy use distributed file system written in go.
Stars: ✭ 256 (+5020%)
Mutual labels:  download, upload
rsync
gokrazy rsync
Stars: ✭ 308 (+6060%)
Mutual labels:  download, upload
Laravel Medialibrary
Associate files with Eloquent models
Stars: ✭ 4,743 (+94760%)
Mutual labels:  laravel, upload
miniprogram-network
Redefine the Network API of Wechat MiniProgram (小程序网络库)
Stars: ✭ 93 (+1760%)
Mutual labels:  download, upload
httputils
Http工具包:OkHttp轻量封装 、功能全面、设计力求优雅与纯粹,Java领域前后端处Http问题的新选择。
Stars: ✭ 21 (+320%)
Mutual labels:  download, upload
Youtube
Upload a video to a single YouTube channel with Laravel 5.
Stars: ✭ 143 (+2760%)
Mutual labels:  laravel, upload
angular-material-datatransfer
A HTML5 datatransfer UI for handling upload and download of multiple simultaneous files.
Stars: ✭ 13 (+160%)
Mutual labels:  download, upload
Upload
Ajax Upload Large File Support jQuery-File-Upload, FileApi, Plupload, Dropzone Support framework Laravel 5
Stars: ✭ 76 (+1420%)
Mutual labels:  laravel, upload
Laravel Filemanager Example 5.3
Demo integration for laravel-filemanager (https://github.com/UniSharp/laravel-filemanager).
Stars: ✭ 100 (+1900%)
Mutual labels:  laravel, upload
kubefilebrowser
kubernetes container filebrowser and webshell
Stars: ✭ 23 (+360%)
Mutual labels:  download, upload
Laravel Ueditor
UEditor integration for Laravel.
Stars: ✭ 392 (+7740%)
Mutual labels:  laravel, upload

Transit

Easy file uploading and downloading for Laravel 5.


Build Status Total Downloads Latest Stable Version License

Features

  • Compatible with Laravel 5
  • Clean API for uploading and downloading files
  • Automated(optional) validation while uploading files
  • Customization options for file storage, model and validation
  • Generators for model and migration
  • Deleting uploaded files
  • A phpunit test suite for easy development

Installation

Installing Transit is simple.

  1. Pull this package in through Composer.

    {
        "require": {
            "kenarkose/transit": "~2.1"
        }
    }
    
  2. In order to register Transit Service Provider add 'Kenarkose\Transit\Provider\TransitServiceProvider' to the end of providers array in your config/app.php file.

    'providers' => array(
    
        'Illuminate\Foundation\Providers\ArtisanServiceProvider',
        'Illuminate\Auth\AuthServiceProvider',
        ...
        'Kenarkose\Transit\Provider\TransitServiceProvider',
    
    ),
    
  3. In order to persist the uploaded file information, you have to create a migration for the 'Kenarkose\Transit\File\File' model, which is the default model used for database persistence. To do so, use the following command.

        php artisan transit:migration
    

    Do not forget to migrate the database when prompted to or after modifying the generated migration file.

  4. You may access the services provided by Transit by using the supplied Facades or from the service container.

    // Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile
    Uploader::upload($uploadedFile);
    app()->make('transit.upload')->upload($uploadedFile);
    
    // Kenarkose\Transit\Contract\Downloadable $fileModel
    return Downloader::download($fileModel);
    return app()->make('transit.download')->download($fileModel);
    

    In order to register the Facades add following the facades to the end of aliases array in your config/app.php file.

    'aliases' => array(
    
        'App'        => 'Illuminate\Support\Facades\App',
        'Artisan'    => 'Illuminate\Support\Facades\Artisan',
        ...
        'Downloader'   => 'Kenarkose\Transit\Facade\Downloader',
        'Uploader'     => 'Kenarkose\Transit\Facade\Uploader',
    
    ),
    
  5. Finally, you may configure the default behaviour of Transit by publishing and modifying the configuration file. To do so, use the following command.

    php artisan vendor:publish
    

    Than, you will find the configuration file on the config/transit.php path. Additional information about the options can be found in the comments of this file. All of the options in the config file are optional, and falls back to default if not specified; remove an option if you would like to use the default.

  6. Please check the tests and source code for further documentation.

Custom Model

You may need a custom model for your case; for instance, when you wish to use Ownable. You can generate a new model for Transit with the following command.

    php artisan transit:model

If you do not wish to use the generator, make sure that your model implements Kenarkose\Transit\Contract\Uploadable interface. Keep in mind that if you would like to use a custom model you should publish the configuration file by using php artisan vendor:publish command and change the class path for model in the configuration file as well. Alternatively you may configure the UploadService on runtime by using the the modelName method. It is required only for UploadService that you register the model name:

Uploader::modelName('Custom\Uploadable\Model');
// or
app()->make('transit.upload')->modelName('Custom\Uploadable\Model');

You may use separate models for Upload and Download services as well as deleting files. But you must implement Kenarkose\Transit\Contract\Uploadable, Kenarkose\Transit\Contract\Downloadable and Kenarkose\Transit\Contract\Deletable interfaces respectively. Furthermore, you may use Kenarkose\Transit\File\Uploadable, Kenarkose\Transit\File\Downloadable and Kenarkose\Transit\File\Deletable traits for providing required functionality to Eloquent models.

License

Transit is released under MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].