mjawad096 / laravel-grapesjs

This package provide an esay way to integrate GrapesJS into your laravel proejct.
MIT License
108 stars 54 forks source link

Correct settings for uploading images on Vagrant #30

Closed insssomniac closed 2 years ago

insssomniac commented 2 years ago

Hi,

I'm using vagrant on the local machine and different site name than 'localhost'. And when i uploading images on the editor, it cannot get them with following message in console: GET http://localhost/storage/laravel-grapesjs/media/355-600x350.jpg net::ERR_CONNECTION_REFUSED

How can i change the host name from localhost to the correct site url?

insssomniac commented 2 years ago

Sorry, looks like I forgot to change sitname in .env. After i set up the correct url I have the error when trying to upload image: "message": "The POST method is not supported for this route. Supported methods: GET, HEAD.",

insssomniac commented 2 years ago

Well, i've found whats was, the default settings was null in the 'assets'/'path' and 'url' section, and after i trying to create symlink with php artisan storage:link it shows an error in console. When i changed the settings below, all working fine

'assets' => [
        'disk' => 'local', //Default: local
        'path' => 'images', //Default: 'laravel-grapesjs/media',
        'upload_url' => 'images'
    ],
ghost commented 2 years ago

@insssomniac it should work with null values as the default should be used if these are null.

Well, i've found whats was, the default settings was null in the 'assets'/'path' and 'url' section, and after i trying to create symlink with php artisan storage:link it shows an error in console. When i changed the settings below, all working fine

'assets' => [
        'disk' => 'local', //Default: local
        'path' => 'images', //Default: 'laravel-grapesjs/media',
        'upload_url' => 'images'
    ],

see this code

config('laravel-grapesjs.assets.path') ?? 'laravel-grapesjs/media'; and config('laravel-grapesjs.assets.upload_url') ?? route('laravel-grapesjs.asset.store');