davide-casiraghi / laravel-cards
A flexible and extensible content container with multiple variants and options.
Requires
- php: ^7.1
- astrotomic/laravel-translatable: ^11.1
- davide-casiraghi/laravel-form-partials: ^1.0
- illuminate/support: 5.8.* || ^6.0
- intervention/image: ^2.4
- mcamara/laravel-localization: ^1.3
- nesbot/carbon: ^2.19
Requires (Dev)
- orchestra/testbench: 3.8.*
- phpunit/phpunit: ^7.0
README
This Laravel package show a responsive card made by text on one side of the page and an image on the other.
The library replace all the occurances of this snippet
{# card card_id=[1] #}
With the some HTML code of a responsive card made by text on one side and an image on the other.
This code uses bootstrap 4.
<div class='row laravel-card' style='background-color: #345642;color: #212529;'> <div class='text col-md-9 my-auto px-4 order-md-1'> <h2 class='laravel-card-heading mt-5'>".$card_1['title']."</h2> <div class='lead mb-4'>".$card_1['body']."</div> </div> <div class='image col-md-3 order-md-2'></div> </div>
Installation
You can install the package via composer:
bash composer require davide-casiraghi/laravel-cards
Publish all the vendor files
php artisan vendor:publish --force
Import the _card.scss file in /resources/scss/app.scss
@import 'vendor/laravel-cards/card';
and then run in console:
npm run dev
Usage
Authorization
To work the package aspect that in your user model and table you have a field called group that can have this possible values:
- null: Registered user
- 1: Super Admin
- 2: Admin
Just the users that have Admin and Super admin privileges can access to the routes that allow to create, edit and delete the blogs, categories and posts. Otherwise you get redirected to the homepage.
Access to the package
After the package is published this new route will be available:
/laravel-cards
Accessing to this routes you can manage the cards.
Then to replace all the occurrance of the card snippets:
use DavideCasiraghi\LaravelCards\Facades\LaravelCards; $text = LaravelCards::replace_card_snippets_with_template($text);
Testing
bash ./vendor/bin/phpunit --coverage-html=html
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email davide.casiraghi@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.