Package Data | |
---|---|
Maintainer Username: | neilcrookes |
Maintainer Contact: | neil.crookes@fivebyfiveuk.com (Neil Crookes) |
Package Create Date: | 2014-02-10 |
Package Last Update: | 2014-03-28 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-14 15:17:37 |
Package Statistics | |
---|---|
Total Downloads: | 271 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 3 |
Total Forks: | 3 |
Total Open Issues: | 0 |
A Laravel 4 package for adding multiple types of widgets like carousels, accordions and tabsets to a website
Add the following to you composer.json file
"fbf/laravel-panels": "dev-master"
Run
composer update
Add the following to app/config/app.php
'Fbf\LaravelPanels\LaravelPanelsServiceProvider'
Publish the config
php artisan config:publish fbf/laravel-panels
Before running the migration, ensure you set up the 'types' you need in your app, in the config file that's been published into your app's config folder.
Run the migration
php artisan migrate --package="fbf/laravel-panels"
Create the relevant image upload directories that you specify in your config, e.g.
public/uploads/packages/fbf/laravel-panels/homepage_carousel/image_1/original
public/uploads/packages/fbf/laravel-panels/homepage_carousel/image_1/resized
public/uploads/packages/fbf/laravel-panels/homepage_carousel/image_2/original
public/uploads/packages/fbf/laravel-panels/homepage_carousel/image_2/resized
public/uploads/packages/fbf/laravel-panels/homepage_accordion/image_1/original
public/uploads/packages/fbf/laravel-panels/homepage_accordion/image_1/resized
public/uploads/packages/fbf/laravel-panels/homepage_accordion/image_2/original
public/uploads/packages/fbf/laravel-panels/homepage_accordion/image_2/resized
Optionally change the dimensions of the images you want to use in the config file.
Optionally run the faker seed
php artisan db:seed --class=Fbf\LaravelPanels\PanelsTableFakeSeeder
In your controller
$carouselPanels = Fbf\LaravelPanels\Panel::getData('HOMEPAGE_CAROUSEL');
$accordionPanels = Fbf\LaravelPanels\Panel::getData('HOMEPAGE_ACCORDION');
return View::make('home')->with(compact('carouselPanels', 'accordionPanels'));
In your blade template:
@include('laravel-panels::carousel', array('panels' => $carouselPanels))
...
@include('laravel-panels::accordion', array('panels' => $accordionPanels))
You can use the excellent Laravel Administrator package by frozennode to administer your carousels, accordions and tabsets.
http://administrator.frozennode.com/docs/installation
Two ready-to-use sample model config files for the Panel model (homepage_carousel.php and homepage_accordion.php) are 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).