Skip to content

alexela8882/laravel-bootstrap-md

Repository files navigation

About

Bootstrap Material Design is a project done by FezVrasta. It is a theme compatible for bootstrap 3 and it's really a nice theme that everyone can work with Laravel 5. You can read more about in this here.

Getting started

Download the zip

Grab the latest stable zip archive of this project. Then skip all steps and proceed to Post Install.

Composer

$ composer create-project laravel/laravel laravel-bootstrap-md "5.2.*" --prefer-dist

Laravel (if you have laravel installed)

$ laravel new laravel-bootstrap-md

Bower

cd into the public folder in your project's root directory

$ bower install bootstrap-material-design

Add the necessary links to your <head> element for fonts and stylsheets:

  <!-- Bootstrap Material -->
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('bower_components/bootstrap/dist/css/bootstrap.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('bower_components/bootstrap-material-design/dist/css/material-icons.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('bower_components/bootstrap-material-design/dist/css/bootstrap-material-design.min.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('bower_components/bootstrap-material-design/dist/css/ripples.min.css') }}">
    <!-- End of Bootstrap Material -->

And before your </body> element for scripts:

  <!-- Bootstrap Material -->
    <script type="text/javascript" src="{{ URL::asset('bower_components/jquery/dist/jquery.min.js') }}"></script>
    <script type="text/javascript" src="{{ URL::asset('bower_components/bootstrap/dist/js/bootstrap.min.js') }}"></script>
    <script type="text/javascript" src="{{ URL::asset('bower_components/bootstrap-material-design/dist/js/material.min.js') }}"></script>
    <script type="text/javascript" src="{{ URL::asset('bower_components/bootstrap-material-design/dist/js/ripples.min.js') }}"></script>
    <script type="text/javascript" src="{{ URL::asset('bower_components/bootstrap-material-design/dist/js/snackbar.min.js') }}"></script>
    <!-- IMPORTANT -->
        <script>
          $.material.init();
        </script>
    <!-- End of Bootstrap Material -->

Note: Material Design Theme don't include material icons when you bower install it. But it's already have been setup in this project and you can run it locally. But if your project is tend for online use you can follow this github.

Post install

cd into project root directory and run:

$ composer install

After all dependencies were already installed, don't forget to generate your key:

$ php artisan key:generate

All Done!

Toastr [optional]

I also find it awesome if I include Toastr in this project.

Bower

cd into public folder of your project and run:

$ bower install toastr

see toastr.js

And add this necessary links after your <head> element:

<!-- Toastr -->
  <link rel="stylesheet" type="text/css" href="{{ URL::asset('bower_components/toastr/toastr.min.css') }}">
  <script type="text/javascript" src="{{ URL::asset('bower_components/jquery/dist/jquery.min.js') }}"></script>
  <script type="text/javascript" src="{{ URL::asset('bower_components/toastr/toastr.min.js') }}"></script>
  <!-- End of Toastr -->

Installation

  1. Either run composer require oriceon/toastr-5-laravel or add "oriceon/toastr-5-laravel": "dev-master" to the require key in composer.json and run composer update.
  2. Add Kamaln7\Toastr\ToastrServiceProvider::class, to the providers key in config/app.php.
  3. Add 'Toastr' => Kamaln7\Toastr\Facades\Toastr::class, to the aliases key in config/app.php.

Run:

$ php artisan vendor:publish

Laravel Authentication [for toastr demo]

cd back into your project root directory and run:

$ php artisan make:auth

Note: If you run this command it is important for all your neccessary links above to put in <yourproject>/resources/views/layouts/app.blade.php.

  1. Configure your .env file and run php artisan migrate. Cloning or downloading this project will not provide with .env file, so you must run this command to make your .env file:
$ php -r "copy('.env.example', '.env');"
  1. Open your project in your favorite editor and go to <yourproject>/resources/views/auth, open login.blade.php and replace it with login.blade.php
  2. Open register.blade.php and replace with register.blade.php
  3. Open AuthController.php and put this code in protected function validator(array $data):
  $title = "Oops!";
  $message = "Please make sure to fill all required fields.";
  $options = [
      'progressBar' => true,
      'positionClass' => 'toast-top-right',
      'timeOut' => 6000,
  ];
  Toastr::error($message, $title, $options);

Run:

$ php artisan serve

Go to http://localhost:8000. Try to register with the invalid authentication and Toastr will appear.

Congratulations!!!

About

Laravel with Bootstrap Material Design

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages