1. Go to this page and download the library: Download novius/laravel-publishable 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/ */
novius / laravel-publishable example snippets
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('text');
$table->timestamps();
$table->publishable(); // Macro provided by the package
});
namespace App\Models;
use \Illuminate\Database\Eloquent\Model;
use \Novius\LaravelPublishable\Publishable;
class Post extends Model {
use Publishable;
...
}