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

    ifox

    09/01/2021, 1:54 PM
    when you point to /img Laravel is running
  • p

    pboivin

    09/01/2021, 1:55 PM
    @ifox so it won't work to simply point /img/... URLs to the CDN then?
  • i

    ifox

    09/01/2021, 1:56 PM
    it should, the /img route is not registered for a specific domain
  • i

    ifox

    09/01/2021, 1:58 PM
    https://github.com/area17/twill/blob/321da81c176ae7aa431c020b69c5580a39f4e6c5/src/RouteServiceProvider.php#L172
  • p

    pboivin

    09/01/2021, 2:03 PM
    Makes sense. But I'm thinking that the CDN is not equipped to distinguish between :
    Copy code
    /img/.../thumbnail.jpg?fm=jpg&q=90&fit=max&crop=2000%2C1334%2C0%2C0&w=800
    /img/.../thumbnail.jpg?fm=jpg&q=90&fit=max&crop=2000%2C1334%2C0%2C0&w=1800
    What ends up on the CDN should be the result of the Glide transformation (resize in this case).
  • u

    user

    09/01/2021, 2:07 PM
    Right, how do I stop Laravel from redirecting me if the image already exists on cdn? I probably didn't understand your point there.
  • u

    user

    09/01/2021, 2:07 PM
    Would it be a bad thing to serve all images from
    /uploads
    folder instead of
    /img
    folder?
  • p

    pboivin

    09/01/2021, 2:09 PM
    @User not at all. I believe that's what
    A17\Twill\Services\MediaLibrary\Local
    does. But I don't think it does image transformations.
  • u

    user

    09/01/2021, 2:14 PM
    So in order to keep the image transformation, I'm supposed to create another disk which would be public and would point to glide_cache folder?
  • u

    user

    09/01/2021, 2:14 PM
    That's how I'd avoid the redirect and keep everything as is?
  • p

    pboivin

    09/01/2021, 2:27 PM
    Very interested in this use case, so I did a quick search and it seems like «The way Glide works is that all requests must be handled by PHP» and «It has no special features to work with CDNs». For reference: https://github.com/thephpleague/glide/issues/131#issuecomment-212516499 I think this use case would require at least a custom image service. But if your project is still at a phase where introducing Imgix is possible, it's definitely worth having a look. It does exactly what your custom image service would do in the end.
    i
    • 2
    • 31
  • e

    elkex

    09/01/2021, 2:28 PM
    When I changed my environment from development to production, my content will not load anymore on my Twill CMS dashboard. Did I miss any steps?
  • p

    pboivin

    09/01/2021, 2:29 PM
    Hi @User , do you have any errors in the browser's console?
  • p

    pboivin

    09/01/2021, 2:31 PM
    @User interesting, did you run
    php artisan twill:update
    on your server after deploying?
  • e

    elkex

    09/01/2021, 2:33 PM
    I did. Unfortunately no success.. It just shows a blank page. That's all folks.
  • p

    pboivin

    09/01/2021, 2:33 PM
    @User what version of Twill are you on?
  • e

    elkex

    09/01/2021, 2:34 PM
    "area17/twill": "^2.0",
  • p

    pboivin

    09/01/2021, 2:34 PM
    Also, did you publish the Twill views in your project? (ie. php artisan vendor:publish ... )
  • i

    ifox

    09/01/2021, 2:36 PM
    that depends on the CDN configuration. On Cloudfront for example, you can enable cache keys varying on query strings
  • e

    elkex

    09/01/2021, 2:37 PM
    I cannot seem to find that full command in the documentation.
    p
    i
    • 3
    • 6
  • i

    Ivan Markov

    09/01/2021, 2:39 PM
    Hi. Please help me find the problem in the installation area17/twill-image (https://github.com/area17/twill-image) When i try to execute:
    Copy code
    php artisan vendor:publish --provider="A17\Twill\Image\ImageServiceProvider" --tag=config
    get a reply
    Copy code
    No publishable resources for tag [config].
    Publishing complete.
  • u

    user

    09/01/2021, 2:39 PM
    Well, the project itself is at least 2 years old, I just hopped in 3 months ago and I'm trying to get used to twill altogether, there's gigabytes of pictures already saved.
  • i

    ifox

    09/01/2021, 2:39 PM
    glide-cdn
  • i

    Ivan Markov

    09/01/2021, 2:44 PM
    i found the correct command .
    Copy code
    php artisan vendor:publish --provider="Croustille\Image\ImageServiceProvider" --tag=config
    the documentation says otherwise
  • i

    ifox

    09/01/2021, 2:46 PM
    @User it isn't tagged yet but the latest and greatest (for docs too) is in the
    develop
    branch
  • i

    ifox

    09/01/2021, 2:47 PM
    https://github.com/area17/twill-image#readme
  • i

    Ivan Markov

    09/01/2021, 3:21 PM
    thanks
  • i

    Ivan Markov

    09/01/2021, 3:48 PM
    @User how to properly disable the default attributes /props ?
  • i

    Ivan Markov

    09/01/2021, 4:01 PM
    can i override blade templates somehow?
  • p

    pboivin

    09/01/2021, 4:04 PM
    @User I think you can pass
    ['imgStyle' => [ ... ]]
    in your image
    $args
1...838485...484Latest