PHP code example of swatty007 / laravel-inline-editor

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

    

swatty007 / laravel-inline-editor example snippets


// config/app.php
'providers' => [
    ...
    swatty007\LaravelInlineEditor\InlineEditorServiceProvider::class,
],

    // app/Providers/AuthServiceProvider.php
    use Illuminate\Contracts\Auth\Access\Gate as GateContract;
    
    public function boot(GateContract $gate)
    {
       //...
        $gate->define('laravel-inline-editor', function ($user) {
            // Add your logic here
            return true;
        });
    }
    

// config/laravel-inline-editor.php
'options' => '{ \'anchor\': { \'targetCheckbox\': true }, \'toolbar\': { \'buttons\': [\'bold\', \'italic\', \'underline\'] } }',

// config/laravel-inline-editor.php
'paths' => [
    'js' => base_path('/resources/assets/js/components'),
    'sass' => base_path('/resources/assets/sass/plugins'),
],

{{-- Custom Database Content Block --}}
{{-- $source_value, $table, $source_key, $target_key, $options --}}
@inlineEditor('example_item', 'example_objects', 'title', 'content' )
    {{ \Illuminate\Support\Facades\DB::table('example_objects')->where('title', 'example_item')->first() }}
@endInlineEditor

{{-- Shows the usage of the options property --}}
@inlineEditor( 'item01', null, null, null, "{ 'anchor': { 'targetCheckbox': true }, 'toolbar': { 'buttons': ['bold', 'italic', 'underline'] } }" )
    <p>Lorem text for our text block</p>
@endInlineEditor