Coder Social home page Coder Social logo

davide-casiraghi / laravel-jumbotron-images Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 226 KB

Add a jumbotron images with title and description to your pages. The titles and descriptions support multilanguage.

License: MIT License

PHP 40.04% HTML 32.89% CSS 4.36% JavaScript 22.71%
laravel jumbotron

laravel-jumbotron-images's Introduction

Laravel Jumbotron Images

Latest Version on Packagist Build Status Quality Score Coverage Status GitHub last commit

Add a jumbotron images with title and description to the pages of your Laravel application.
The titles and descriptions support multilanguage.

Installation

You can install the package via composer:

composer require davide-casiraghi/laravel-jumbotron-images

Publish all the vendor files

php artisan vendor:publish --force

Run the database migrations

php artisan migrate

Add the JS files to /resources/js/app.js

require('./vendor/laravel-jumbotron-images/jquery.stellar');  
require('./vendor/laravel-jumbotron-images/laravel-jumbotron-images');  

Add the SCSS file to /resources/sass/app.scss

@import 'vendor/laravel-jumbotron-images/laravel-jumbotron-images';

Add your jumbotrons to the jumbotrons table

Once you have published the package you can go to this route to manage your jumbotrons:
/jumbotron-images

Usage

Include the facade in your controller:

use DavideCasiraghi\LaravelJumbotronImages\Facades\LaravelJumbotronImages;

In the controller, pass to the view the Jumbotron datas. (In this case we want to show the jumbotron with id = 1)

$jumbotronImage = LaravelJumbotronImages::getJumbotronImage(1);
return view('welcome', [
    'jumbotronImage' => $jumbotronImage,
    'jumbotronImageParameters' => LaravelJumbotronImages::getParametersArray($jumbotronImage),
]);

Then include in the view the jumbotron view.

@include('vendor.laravel-jumbotron-images.show-jumbotron-image', $jumbotronImage)

The snippet

The library replace all the occurrences of this kind of snippet

{# jumbotron id=[1] #}

Testing

You can run unit tests checking the code coverage using this command.

./vendor/bin/phpunit --coverage-html=html

So you can find the reports about the code coverage in this file /html/index.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 [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.