Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor doesn't load the page content and can't save #76

Open
kadrian92 opened this issue Jun 13, 2023 · 4 comments
Open

Editor doesn't load the page content and can't save #76

kadrian92 opened this issue Jun 13, 2023 · 4 comments

Comments

@kadrian92
Copy link

I'm trying to use this package in my laravel project.

When I go to this link: http://1.1.1.1:8000/admin/pages/1/editor then the editor loads, but with a blank page. I getting an error in the console tab: The defination for plugin 'gjs-plugin-ckeditor' not found. I haven't changed anything in the config.

Page model:

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Dotlogics\Grapesjs\App\Traits\EditableTrait;
use Dotlogics\Grapesjs\App\Contracts\Editable;


class Page extends Model implements Editable
{
    use HasFactory, EditableTrait;

    protected $fillable = ['title', 'content', 'author', 'permalink', 'password', 'status'];

    protected $casts = [
        'password' => 'boolean',
    ];
    
}

I added use EditorTrait;and the editor method into the PageController :

public function editor(Request $request, Page $page)
    {
        return $this->show_gjs_editor($request, $page);
    }

And the route is Route::get('pages/{page}/editor', [BackendPageController::class, 'editor']);

And I can't save what I doing in the editor because I get a 403 error if I click on the save button.

http://1.1.1.1:8000/laravel-grapesjs/App-Models-Page/1 403 (Forbidden)

You can see everything in the picture:

error

@mohamad-supangat
Copy link

do you have gjs_data column on Page model ??

image

this column use to store the grapesjs data

@kadrian92
Copy link
Author

Yes, I added it manually to the pages table as JSON type

@rahulalam31
Copy link

@kadrian92 in your config see laravel-grapejs.php file and check for routes, disable the auth middleware and your 403 will be solved.
image

@pradeepceb
Copy link

Screenshot from 2024-08-22 16-13-26

Hi Team, When i Render PHP file into grape JS Only php code is diplay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants