PHP code example of starsoft / laravel-editor

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

    

starsoft / laravel-editor example snippets

 
    /**
     * Display a listing of the resource.
     *
     * @return Response
     */
    public function index(Page $page)
    {
        return $page->getEditor();
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param Request $request
     * @return Response
     */
    public function store(Request $request, Page $page)
    {
        return $page->saveEditorData($request);

    }

    public function templates(Page $page)
    {
       return array_merge(
           $page->getTemplatesFromPath(config('cms.templatesPath')),
           $page->getBlocksFromPath(config('cms.blocksPath')),
        );
    }

php artisan vendor:publish --provider="LaraEditor\LaraEditorServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="migrations"
php artisan migrate