dev-master
9999999-devA Laravel 4 package for adding content managed 'downloads' to a site
MIT
The Requires
- php >=5.3.0
- illuminate/support 4.1.*
by Neil Crookes
A Laravel 4 package for adding content managed 'downloads' to a site
A Laravel 4 package for adding content managed 'downloads' to a site, (*1)
Add the following to you composer.json file, (*2)
"fbf/laravel-downloads": "dev-master"
Run, (*3)
composer update
Add the following to app/config/app.php, (*4)
'Fbf\LaravelDownloads\LaravelDownloadsServiceProvider'
Publish the config, (*5)
php artisan config:publish fbf/laravel-downloads
Run the migration, (*6)
php artisan migrate --package="fbf/laravel-downloads"
Create the relevant image upload directories that you specify in your config, e.g., (*7)
public/uploads/packages/fbf/laravel-downloads/downloads public/uploads/packages/fbf/laravel-downloads/images/original public/uploads/packages/fbf/laravel-downloads/images/resized
In your views you can do something like the following:, (*8)
<p class="download--{{ strtolower($download->extension) }}"> <a href="{{ $download->getRelativePath() }}" title="{{ $download->title }}"> <img src="{{ $download->getImageRelativePath('resized') }}" alt="{{ $download->title }}" width="{{ $download->getImageWidth('resized') }}" height="{{ $download->getImageHeight('resized') }}" /> Download our {{ $download->title }} </a> [{{ $download->extension }}, {{ $download->human_readable_filesize }}] </p>
You can use the excellent Laravel Administrator package by frozennode to administer your images., (*9)
http://administrator.frozennode.com/docs/installation, (*10)
A ready-to-use model config file for the Download model (downloads.php) is provided in the src/config/administrator directory of the package, which you can copy into the app/config/administrator directory (or whatever you set as the model_config_path in the administrator config file)., (*11)
A Laravel 4 package for adding content managed 'downloads' to a site
MIT