PHP code example of van-ons / laraberg-nova

1. Go to this page and download the library: Download van-ons/laraberg-nova 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/ */

    

van-ons / laraberg-nova example snippets


LarabergNova::make(__('Content'), 'content')

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use VanOns\Laraberg\Traits\RendersContent;

class Post extends Model
{
    use HasFactory, RendersContent;
    
    protected $contentColumn = 'content';
       
    ...
}

{!! $model->render() !!}

LarabergNova::make(__('Content'), 'content')->height(600)

LarabergNova::make(__('Content'), 'content')->withFiles('public')

Schema::create('laraberg_nova_pending_attachments', function (Blueprint $table) {
    $table->increments('id');
    $table->string('draft_id')->index();
    $table->string('attachment');
    $table->string('disk');
    $table->timestamps();
});

Schema::create('laraberg_nova_attachments', function (Blueprint $table) {
    $table->increments('id');
    $table->string('attachable_type');
    $table->unsignedInteger('attachable_id');
    $table->string('attachment');
    $table->string('disk');
    $table->string('url')->index();
    $table->timestamps();
    $table->index(['attachable_type', 'attachable_id']);
});
bash
php artisan vendor:publish --provider="VanOns\Laraberg\LarabergServiceProvider"