https://twill.io logo
Join Discord
Powered by
# ❓questions
  • p

    pboivin

    07/10/2021, 1:16 PM
    Hey @User , what's in your .env for MEDIA_* configuration?
  • l

    Luís Novais

    07/10/2021, 1:17 PM
    my twill config
  • l

    Luís Novais

    07/10/2021, 1:17 PM
    <?php return [ 'enabled' => [ 'settings' => true, ], 'media_library' => [ 'disk' => 'twill_media_library', 'endpoint_type' => env('MEDIA_LIBRARY_ENDPOINT_TYPE', 'local'), 'cascade_delete' => env('MEDIA_LIBRARY_CASCADE_DELETE', true), 'local_path' => env('MEDIA_LIBRARY_LOCAL_PATH', '/'), 'image_service' => env('MEDIA_LIBRARY_IMAGE_SERVICE', 'A17\Twill\Services\MediaLibrary\Glide'), 'acl' => env('MEDIA_LIBRARY_ACL', 'private'), 'filesize_limit' => env('MEDIA_LIBRARY_FILESIZE_LIMIT', 50), 'allowed_extensions' => ['jpg', 'jpeg', 'png'], 'init_alt_text_from_filename' => true, ], 'glide' => [ 'base_url' => '', 'base_path' => '/storage/' ], 'file_library' => [ 'disk' => 'twill_file_library', 'endpoint_type' => env('FILE_LIBRARY_ENDPOINT_TYPE', 'local'), 'cascade_delete' => env('FILE_LIBRARY_CASCADE_DELETE', true), 'local_path' => '/', 'file_service' => env('FILE_LIBRARY_FILE_SERVICE', 'A17\Twill\Services\FileLibrary\Disk'), 'acl' => env('FILE_LIBRARY_ACL', 'private'), 'filesize_limit' => env('FILE_LIBRARY_FILESIZE_LIMIT', 50), 'allowed_extensions' => ['pdf'], ], ];
  • p

    pboivin

    07/10/2021, 1:18 PM
    Sorry I meant your
    .env
    file at the root of your project. You should have something like this in there :
  • p

    pboivin

    07/10/2021, 1:18 PM
    MEDIA_LIBRARY_ENDPOINT_TYPE=local MEDIA_LIBRARY_IMAGE_SERVICE=A17\Twill\Services\MediaLibrary\Glide
  • l

    Luís Novais

    07/10/2021, 1:21 PM
    my .env
  • l

    Luís Novais

    07/10/2021, 1:21 PM
    APP_NAME=Laravel APP_ENV=local APP_KEY=base64:P6e3ZNCDs6O6L/8B9E7fvTV92U+7en7LTq+6KRERoWI= APP_DEBUG=true APP_URL=mylaravel.test ADMIN_APP_URL=mylaravel.test ADMIN_APP_PATH=admin LOG_CHANNEL=stack LOG_LEVEL=debug DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=mylaravel DB_USERNAME=root DB_PASSWORD= BROADCAST_DRIVER=log CACHE_DRIVER=file FILESYSTEM_DRIVER=local QUEUE_CONNECTION=sync SESSION_DRIVER=file SESSION_LIFETIME=120 MEMCACHED_HOST=127.0.0.1 REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_MAILER=smtp MAIL_HOST=mailhog MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS=null MAIL_FROM_NAME="${APP_NAME}" AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET= AWS_USE_PATH_STYLE_ENDPOINT=false PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= PUSHER_APP_CLUSTER=mt1 MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
  • p

    pboivin

    07/10/2021, 1:25 PM
    Try commenting out
    media_library
    ,
    glide
    and
    file_library
    from your
    twill.php
    and configuring through your
    .env
    . Something like :
  • p

    pboivin

    07/10/2021, 1:25 PM
    MEDIA_LIBRARY_ENDPOINT_TYPE=local MEDIA_LIBRARY_IMAGE_SERVICE=A17\Twill\Services\MediaLibrary\Glide FILE_LIBRARY_ENDPOINT_TYPE=local FILE_LIBRARY_LOCAL_PATH=uploads/
  • l

    Luís Novais

    07/10/2021, 1:28 PM
    dont work, give upload error
  • l

    Luís Novais

    07/10/2021, 1:28 PM
    getting this /storage/e0801076-b966-4f89-a92f-b330cc77cc24/destaque-image.jpg?fm=jpg&q=80&fit=max&crop=514%2C514%2C105%2C0
  • p

    pboivin

    07/10/2021, 1:39 PM
    Not sure about this part of your config :
    Copy code
    'glide' => [
        'base_url' => '',
        'base_path' => '/storage/'
      ],
    Have you tried with
    'base_path' => 'img'
    ?
  • i

    ifox

    07/10/2021, 3:15 PM
    @Luís Novais please make sure to comment all your media library configuration as @pboivin advised, use the .env variables he provided, run
    php artisan storage:link
    , and make sure your configuration cache is cleared.
  • v

    void

    07/10/2021, 3:15 PM
    yup that was it
  • v

    void

    07/10/2021, 3:15 PM
    .env was cached
  • u

    user

    07/10/2021, 3:29 PM
    Hi, can anyone share links for laravel/php discord for general discussion and coding help? Thanks in advance.
  • v

    void

    07/10/2021, 3:30 PM
    https://discord.gg/3AgRufEA
  • v

    void

    07/10/2021, 3:30 PM
    https://discord.gg/Qb5t8CAk
  • u

    user

    07/10/2021, 3:43 PM
    Thank you so much.
  • u

    user

    07/10/2021, 3:45 PM
    Still don't have posting permission. If it's not much of an issue, can I get an answer to this... I am using multidomain package... all is good so far... different dbs, different storage path... but now I want to set a domain specific folder for views.... i didn't find anything for .env file... how do I set this so that each domain can access its /views/ folder....? Pls. share your thoughts or links or any pointers to achieve this. Thank you again..
  • v

    void

    07/10/2021, 3:59 PM
    using the Twill multi-tenant feature?
  • v

    void

    07/10/2021, 4:00 PM
    or you are talking about other mutli/tenant/subdomain packages?
  • u

    user

    07/10/2021, 4:07 PM
    https://github.com/gecche/laravel-multidomain - using this
  • v

    void

    07/10/2021, 4:16 PM
    I guess you could make folders inside views for each, domain1, domain2 and make a function that depending where the request comes from returns specific folder+views
  • v

    void

    07/10/2021, 4:18 PM
    Not aware of a package doing this for you, although it can be simple here some Link for your research https://stackoverflow.com/questions/63441971/how-to-use-multiple-domains-with-different-pages-and-routes-in-laravel/63442241#63442241 https://laracasts.com/discuss/channels/laravel/one-app-multiple-view-routes-and-domains-assigned-to-it
  • u

    user

    07/10/2021, 4:19 PM
    I did get the second link. But am clueless how to go about it... for example, i will create a helpers.php and paste this code - <?php function viewForDomain($view, $data = [], $mergeData = []) { $domain = str_replace('.', '_', str_replace('http://', '', url('/'))); if (view()->exists($domain.'.'.$view)) { return view($domain.'.'.$view, $data, $mergeData); } else{ return view('base.'.$view, $data, $mergeData); } } ?>
  • u

    user

    07/10/2021, 4:20 PM
    How do I trigger this function? or call this whenever i return a view... I am so sorry if my questions are too lame.
  • v

    void

    07/10/2021, 4:33 PM
    This can actually get to be a complicated matter definitely not lame so that helper is triggered instead of returning view()
  • v

    void

    07/10/2021, 4:33 PM
    that second link towards the end shows more on that
  • v

    void

    07/10/2021, 4:34 PM
    https://laracasts.com/discuss/channels/laravel/one-app-multiple-view-routes-and-domains-assigned-to-it?reply=179242
1...596061...484Latest