PHP code example of caffeinated / plugins

1. Go to this page and download the library: Download caffeinated/plugins library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

caffeinated / plugins example snippets


Caffeinated\Plugins\PluginsServiceProvider::class,

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


namespace App\Plugins;

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

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

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