PHP code example of syscage / laravel-plugin

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

    

syscage / laravel-plugin example snippets


// app/Models//Plugin.php
namespace App\Models\Dashboard\System;

use Syscage\Plugin\Models\PluginRecord;

class Plugin extends PluginRecord
{
    //
}

// config/plugin.php
'model' => \App\Models\Dashboard\System\Plugin::class,
bash
composer vendor:publish --tag=plugin-config
php artisan vendor:publish --tag=plugin-migrations
php artisan migrate
bash
php artisan make:plugin BlogPost --description="Blog integration"
php artisan plugin:install blog-post

plugins/blog-post/
├── src/
│   ├── app/
│   │   ├── Http/{Controllers,Middleware,Requests}/
│   │   ├── Models/
│   │   └── Providers/BlogPluginPluginServiceProvider.php
│   ├── config/config.php
│   ├── database/{migrations,factories,seeders}/
│   ├── lang/
│   ├── public/
│   ├── resources/{css,js,views}/
│   ├── routes/{web,api,console}.php
│   └── Plugin.php
├── composer.json
├── plugin.json
└── README.md
bash
php artisan make:model-plugin blog-post Post -mfs
php artisan make:controller-plugin blog-post PostController --resource
php artisan migrate-plugin blog-post
php artisan db:seed-plugin blog-post
php artisan route:list-plugin blog-post
php artisan test-plugin blog-post