Skip to content
This repository has been archived by the owner on Aug 7, 2019. It is now read-only.

caffeinated/plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

This package has been abandoned and is no longer maintained.

Caffeinated Plugins

Laravel 5.1 Laravel 5.2 Source License

Abstraction layer between Blade/Twig to allow the means to "plug in" data through a consistent interface.

Quick Installation

Begin by installing the package through Composer.

composer require caffeinated/plugins=~2.0

Once this operation is complete, simply add both the service provider and facade classes to your project's config/app.php file:

Service Provider

Caffeinated\Plugins\PluginsServiceProvider::class,

Facade

'Plugin' => Caffeinated\Plugins\Facades\Plugin::class,

And that's it! With your coffee in reach, start plugging in some data!

Quick Usage

Build your plugin: app\Plugins\YourPlugin.php

<?php
namespace App\Plugins;

class YourPlugin
{
	public function run()
	{
		return 'Whatever you want';
	}
}

Register your plugin, ideally within a service provider:

Plugin::register('plugin_name', 'App\Plugins\YourPlugin');

Now simply use it!

{{ @plugin_name() }}  // Echo's "whatever you want" in this case