PHP code example of jumilla / laravel-addomnipot
1. Go to this page and download the library: Download jumilla/laravel-addomnipot 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/ */
jumilla / laravel-addomnipot example snippets
'providers' => [
Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
...
// Add the folloing line.
Jumilla\Addomnipot\Laravel\ServiceProvider::class,
],
$addon = addon('blog');
namespace Blog\Http\Controllers;
class BlogController
{
public function index()
{
$addon = addon(); // == addon(addon_name())
Assert::same('blog', $addon->name());
}
}
$addon = addon();
$addon->path(); // {$root}/addons/blog
$addon->relativePath(); // addons/blog
$addon->phpNamespace(); // Blog
$addon->config('page.row_limit', 20);
$addon->trans('emails.title');
$addon->transChoice('emails.title', 2);
$addon->view('layouts.default');
$addon->spec('forms.user_register');
$name = addon_name(get_class($this));
$name = addon_name(\Blog\Providers\AddonServiceProvider::class); // 'blog'
namespace Blog\Http\Controllers;
class PostsController
{
public function index()
{
$name = addon_name(); // 'blog'
}
}
sh
php artisan route:list
sh
php artisan serve
sh
php artisan addon:list
sh
php artisan addon:status
sh
php artisan addon:name blog Wonderful/Blog
sh
php artisan addon:remove blog;
sh
php artisan make:addon blog library
php artisan make:addon blog-app ui
sh
php artisan make:addon blog
function index()
{
return \View::make()
}