2017 © Pedro Peláez
 

library miravel

Theme engine for the Laravel framework

image

miravel/miravel

Theme engine for the Laravel framework

  • Tuesday, July 3, 2018
  • by miravel
  • Repository
  • 2 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 17 Versions
  • 0 % Grown

The README.md

Warning Warning: work in progress

Miravel is currently a work in progress and cannot yet be used in real projects. Most things described below are not yet implemented. When a usable version is released, this warning will go away., (*1)

Miravel

A theme engine for the Laravel framework, with its own theme repository, and with the ability for everyone to develop and contribute their own themes., (*2)

The full documentation is available at: https://miravel.io/docs, (*3)

Features:

  • Miravel comes with a default theme that already contains most popular layouts: fluid, fixed width, one- and two-column, sticky footer, form centered on a screen etc.
  • Themes consists of skins, layouts, elements (blocks) and templates. All of them can be used independently and even with conjunction with components from other themes.
  • Miravel is very inobtrusive and can co-exist with any other frontend logic, being called / used only when needed. You can limit its use for only a couple of layouts/elements should you so decide.
  • Offers special Blade tags @element, @js, @css, etc.
  • Whenever you need, override the entire theme or any of its components (css, js, view files) separately in your app.
  • Command line interface offers one-liners for many complex operations, e.g. "install this theme and use its 'home page' template as my home page".
  • Templates are built with Blade and around php variables, so in many cases all you need is just to eloquent-pull data into a variable with proper name.
  • But of course you can easily add custom logic to elements by creating your own class for an element.
  • Themes can inherit (extend / override) each other.
  • Miravel leverages Assetic to easily orchestrate asset build pipeline (such as css/js preprocessing, concatenation, minification etc).
  • And also has tools for creating a very fine-grained asset build for every specific page of your app. Some pages do not need jQuery? No problem, create a jquery-less app.js just for these pages. Miravel automates most of these routines.
  • Setting a theme as "Global" automatically gives you the error pages and basic email templates that are consistent with the chosen theme/skin.
  • It is just a Laravel miracle.

Usage

Quick dive into using Miravel with your Laravel project:, (*4)

Pull in the package

composer require miravel/miravel

Laravel 5.4 or earlier, or Laravel 5.5 without auto-discovery

Below Laravel 5.5, package auto-discover is not available so some extra steps are also necessary:, (*5)

Add the provider and facade to your config/app.php, (*6)

'providers' => [
//...
Miravel\ThemeServiceProvider::class,
//...
],
'aliases' => [
//...
'Miravel' => Miravel\Facade::class,
//...
],

Use a template

This line will replace your welcome.blade.php with a template from Miravel's default theme:, (*7)

php artisan miravel:use default.home-page --as=welcome

And go visit your page in browser to see the change., (*8)

Use a layout

You can use Miravel's theme layouts as you traditionally do that by extending them inside your blade views:, (*9)

@extends('miravel::default.one-column')

@section('content')
Awesome stuff here
@endsection

Your awesome stuff will be placed inside the "one-column" layout from the "default" theme., (*10)

Use an element

Inside your view:, (*11)

// Assuming "$items" is holding something like this
// [['text' => 'Home', 'url' => '/'], ['text' => 'About Us', 'url' => '/about']]
// this will render the "menu" template from the "default" theme with these items.

@element('default.menu', $items);

Override any layout or element

To start playing with the view file, just copy it from the vendor folder to app/resources/views/vendor/miravel/theme-name., (*12)

E.g. to override the "fixed" layout from the "default" theme, copy:, (*13)

vendor/miravel/miravel/resources/themes/default/layouts/fixed/view.blade.php, (*14)

to, (*15)

app/resources/vendor/miravel/default/layouts/fixed/view.blade.php, (*16)

Miravel offer an artisan one-liner for this operation to somewhat shorten your typing:, (*17)

php artisan miravel:clone default.layouts.fixed.view

or to pull the entire layout (with all styles and scripts), (*18)

php artisan miravel:clone default.layouts.fixed

to pull the entire theme, (*19)

php artisan miravel:clone default

You get the idea., (*20)

The Versions

03/07 2018

dev-master

9999999-dev

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Serhiy Neskhodovskiy

03/07 2018

dev-build

dev-build

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Serhiy Neskhodovskiy

19/04 2018

v0.4.0

0.4.0.0

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Serhiy Neskhodovskiy

19/04 2018

v0.3.1

0.3.1.0

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Serhiy Neskhodovskiy

16/04 2018

dev-manifest

dev-manifest

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Serhiy Neskhodovskiy

13/04 2018

v0.3.0

0.3.0.0

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Serhiy Neskhodovskiy

13/04 2018

dev-resources

dev-resources

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Serhiy Neskhodovskiy

12/04 2018

v0.2.2

0.2.2.0

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Serhiy Neskhodovskiy

06/04 2018

v0.2.1

0.2.1.0

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Serhiy Neskhodovskiy

06/04 2018

v0.2.0

0.2.0.0

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Serhiy Neskhodovskiy

30/03 2018

v0.1.4

0.1.4.0

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Serhiy Neskhodovskiy

30/03 2018

dev-namespaces

dev-namespaces

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

 

by Serhiy Neskhodovskiy

30/03 2018

v0.1.3

0.1.3.0

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

 

by Serhiy Neskhodovskiy

30/03 2018

v0.1.2

0.1.2.0

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

 

by Serhiy Neskhodovskiy

30/03 2018

v0.1.1

0.1.1.0

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

 

by Serhiy Neskhodovskiy

30/03 2018

v0.1.0

0.1.0.0

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

 

by Serhiy Neskhodovskiy

28/03 2018

dev-commands

dev-commands

Theme engine for the Laravel framework

  Sources   Download

MIT

The Requires

  • php ^7.0

 

by Serhiy Neskhodovskiy