Skip to content

Instantly share code, notes, and snippets.

@iamneaz
Forked from jacurtis/1) Main.blade.php
Created November 29, 2020 21:06
Show Gist options
  • Select an option

  • Save iamneaz/bf5cda9e376abe50f765b7d874c2c67d to your computer and use it in GitHub Desktop.

Select an option

Save iamneaz/bf5cda9e376abe50f765b7d874c2c67d to your computer and use it in GitHub Desktop.

Revisions

  1. @jacurtis jacurtis created this gist Feb 16, 2017.
    45 changes: 45 additions & 0 deletions 1) Main.blade.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    <!-- This is the main Blade file that you want your components to show up in -->

    <!DOCTYPE html>
    <html lang="{{ config('app.locale') }}">
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Laravel</title>

    <!-- Fonts -->
    <link href="{{mix('css/app.css')}}" rel="stylesheet" type="text/css">

    <!-- Styles -->

    </head>
    <body>
    <div class="container">
    @component('components.jumbotron')
    @slot('title')
    Welcome DevMarketers!
    @endslot

    This is an awesome tutorial about all the new features that have arrived in Laravel 5.4. I recommend leaving a like if you enjoyed this video and a comment about what you want to learn next! Thanks so much for your support. Go DevMarketers!

    @slot('button')
    Click Like!
    @endslot
    @endcomponent

    @component('components.alert')
    @slot('type')
    danger
    @endslot --}}

    @slot('title')
    Error!
    @endslot

    We could not process your request...
    @endcomponent
    </div>
    </body>
    </html>
    5 changes: 5 additions & 0 deletions 2) components.jumbotron.blade.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    <div class="jumbotron">
    <h1>{{$title}}</h1>
    <p>{{$slot}}</p>
    <p><a class="btn btn-primary btn-lg" href="#" role="button">{{$button or "Learn More"}}</a></p>
    </div>
    6 changes: 6 additions & 0 deletions 3) components.alert.blade.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    <div class="alert alert-{{$type or 'success'}}" role="alert">
    @if (isset($title))
    <h2>{{$title}}</h2>
    @endif
    {{$slot}}
    </div>