PHP code example of laravel-plus / extension

1. Go to this page and download the library: Download laravel-plus/extension 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/ */

    

laravel-plus / extension example snippets


	'providers' => [
		Illuminate\View\ViewServiceProvider:class,
		...
		// Add the folloing line.
		LaravelPlus\Extension\ServiceProvider::class,
	],

	'providers' => [
		// Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::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\Controllers;

class PostsController
{
	public function index()
	{
		$name = addon_name();		// 'blog'
	}
}
sh
php artisan route:list
sh
php artisan serve
sh
php artisan database:status
sh
php artisan database:upgrade
sh
php artisan database:upgrade --seed <seed>
sh
php artisan database:clean
sh
php artisan database:refresh
sh
php artisan database:refresh --seed <seed>
sh
php artisan database:rollback <group>
sh
php artisan database:again <group>
sh
php artisan database:again <group> --seed <seed>
sh
php artisan database:seed <seed>
sh
php artisan database:seed
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 ui
sh
php artisan make:addon blog
sh
$ php artisan make:controller FooController
sh
$ php artisan make:event FooEvent
sh
$ php artisan make:job FooJob
sh
$ php artisan make:job /Commands/FooCommand
sh
$ php artisan make:migration App_1_0
sh
$ php artisan make:migration App_1_1 --create=materials
sh
$ php artisan make:migration App_1_2 --update=materials
sh
$ php artisan make:migration Blog_1_0 --addon=blog
sh
$ php artisan make:model services/models/foo
sh
$ php artisan make:provider FooServiceProvider
sh
$ php artisan make:request FooRequest
sh
$ php artisan make:request staging
sh
$ php artisan make:test FooTests

function index()
{
	return \View::make()
}