Coder Social home page Coder Social logo

skydiver / laravel-materialize-css Goto Github PK

View Code? Open in Web Editor NEW
44.0 11.0 11.0 2.82 MB

Materialize CSS Framework for Laravel 5

License: MIT License

PHP 100.00%
materializecss-framework php laravel laravel-5-package laravel-themes materializecss material-design

laravel-materialize-css's Introduction

laravel-materialize-css

Materialize CSS Framework for Laravel 5 [http://materializecss.com/]

Installation

  • Require this package in your composer.json and run composer update.
    "skydiver/laravel-materialize-css": "dev-master"
  • After updating composer, add ServiceProvider to the providers array in config/app.php
    Skydiver\LaravelMaterializeCSS\MaterializeCSSServiceProvider::class,
  • Add Facade to the aliases array in config/app.php
	'MaterializeCSS' => Skydiver\LaravelMaterializeCSS\MaterializeCSS::class,
  • Then publish the package's assets to public folder:
    $ php artisan vendor:publish --tag=materializecss --force

Updates

You can re-publish the assets automatically when composer updated the package:

  • In your composer.json, go to scripts > post-update-cmd section, add the next line:
    "php artisan vendor:publish --tag=materializecss --force"
  • The code will look similar to:
    "post-update-cmd": [
        "php artisan optimize",
        "php artisan vendor:publish --tag=materializecss --force"
    ],

Usage

There are differents methods to include Materialize CSS assets:

  • include_full()
    {!! MaterializeCSS::include_full() !!}
    <link rel="stylesheet" charset="utf-8" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" charset="utf-8" href="http://yourdomain.com/materialize-css/css/materialize.min.css">
    <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
    <script type="text/javascript" src="http://yourdomain.com/materialize-css/js/materialize.min.js"></script>
  • include_all()
    {!! MaterializeCSS::include_all() !!}
    <link rel="stylesheet" charset="utf-8" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" charset="utf-8" href="http://yourdomain.com/materialize-css/css/materialize.min.css">
    <script type="text/javascript" src="http://yourdomain.com/materialize-css/js/materialize.min.js"></script>
  • include_css()
    {!! MaterializeCSS::include_css() !!}
    <link rel="stylesheet" charset="utf-8" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" charset="utf-8" href="http://yourdomain.com/materialize-css/css/materialize.min.css">
  • include_js()
    {!! MaterializeCSS::include_js() !!}
    <script src="http://yourdomain.com/materialize-css/js/materialize.min.js"></script>
  • include_secure_css()
    {!! MaterializeCSS::include_secure_css() !!}
    <link rel="stylesheet" href="https://yourdomain.com/materialize-css/css/materialize.min.css">
  • include_secure_js()
    {!! MaterializeCSS::include_secure_js() !!}
    <script type="text/javascript" src="http://yourdomain.com/materialize-css/js/materialize.min.js"></script>
  • get_url_css($full=false, $secure=false)
    {!! MaterializeCSS::get_url_css() !!}
    {!! MaterializeCSS::get_url_css(true, false) !!}
    {!! MaterializeCSS::get_url_css(false, true) !!}
    {!! MaterializeCSS::get_url_css(true, true) !!}
    /materialize-css/css/materialize.min.css
    http://yourdomain.com/materialize-css/css/materialize.min.css
    /materialize-css/css/materialize.min.css
    https://yourdomain.com/materialize-css/css/materialize.min.css
  • get_url_js($full=false, $secure=false)
    {!! MaterializeCSS::get_url_js() !!}
    {!! MaterializeCSS::get_url_js(true, false) !!}
    {!! MaterializeCSS::get_url_js(false, true) !!}
    {!! MaterializeCSS::get_url_js(true, true) !!}
    /materialize-css/js/materialize.min.js
    http://yourdomain.com/materialize-css/js/materialize.min.js
    /materialize-css/js/materialize.min.js
    https://yourdomain.com/materialize-css/js/materialize.min.js

laravel-materialize-css's People

Contributors

julianchristmas avatar ryanrapini avatar skydiver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-materialize-css's Issues

Call to undefined method Illuminate\Foundation\Application::bindShared()

Hi,

Through the version 5.2.5 of Laravel framework, I had a compatibility issue related with the method bindShared() in the Illuminate HTML. Searching a bit about, I found a issue repported about in :(https://github.com/illuminate/html/pull/31/files), where the solution recommended is change the method bindShared() to singleton() at the service provider php file(HtmlServiceProvider.php).

So, in resuming, I had the same issue to install the MaterializeCSS package, and to solve it (apparently), I have done the same change at the service provider php file (MaterializeCSSServiceProvider.php).

Well, sorry if it's not sounds like a glue for it (I'm starting with Laravel :-P), anyway I hope this helps :-)

Class 'MaterializeCSS' not found

Hi, I followed your instruction and has successfully installed the library. However, when I try to use it inside the blade file, I get a fatal error Class 'MaterializeCSS' not found. I already added the MaterializeCSSServiceProvider in config/app.php, what else am I missing? TIA!

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.