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

    ifox

    06/22/2021, 10:41 AM
    Hi @obfuscate! The tags form field is not meant to be used to relate to another model, but only to create actual tags in the tags table. You can use the multiselect or checkboxes fields to do what you're looking for though.
  • o

    obfuscate

    06/22/2021, 10:45 AM
    Thanks of the clarification. Just out of curiosity, how is it implemented in the demo?
  • i

    ifox

    06/22/2021, 10:48 AM
    https://gist.github.com/ifox/0f83ce191f6e46e36b966b532c1d82a0#file-form-blade-php
  • i

    ifox

    06/22/2021, 10:50 AM
    Copy code
    'sectorsList' => app(SectorRepository::class)->listAll('title'), 
    'disciplinesList' => app(DisciplineRepository::class)->listAll('title'),
  • i

    ifox

    06/22/2021, 10:50 AM
    in the controller's
    formData
  • i

    ifox

    06/22/2021, 10:51 AM
    Copy code
    $object->disciplines()->sync($fields['disciplines'] ?? []);
            $object->sectors()->sync($fields['sectors'] ?? []);
  • i

    ifox

    06/22/2021, 10:52 AM
    in the repository's
    afterSave
  • o

    obfuscate

    06/22/2021, 10:52 AM
    @ifox Got it. This is very helpful, thanks a lot
  • a

    antonioribeiro

    06/22/2021, 3:19 PM
    Hello everyone! We are trying to deploy a Twill app to Vapor, it's actually already deployed and working, we sent some PRs to Twill in order for it to work, but we found an issue related to the icons (we are missing them so much right now...), which are SVG stuffed directly into the HTML, at Blade compile time:
    Copy code
    @if(config('twill.dev_mode', false))
        {!! file_get_contents(twillAsset('icons.svg')) !!}
        {!! file_get_contents(twillAsset('icons-files.svg')) !!}
        {!! file_get_contents(twillAsset('icons-wysiwyg.svg')) !!}
    @else
        {!! File::exists(public_path(twillAsset('icons.svg'))) ? File::get(public_path(twillAsset('icons.svg'))) : '' !!}
        {!! File::exists(public_path(twillAsset('icons-files.svg'))) ? File::get(public_path(twillAsset('icons-files.svg'))) : '' !!}
        {!! File::exists(public_path(twillAsset('icons-wysiwyg.svg'))) ? File::get(public_path(twillAsset('icons-wysiwyg.svg'))) : '' !!}
    @endif
    The problem is that Vapor deletes all files from the public directory (they are uploaded to S3 during deployment) and we don't see a way of telling it to not do it unless we fork the
    vapor-cli
    script and change it ourselves. At the same time Twill expects the SVG files to be present on
    /public
    . Even if we overload
    twillAsset()
    to load those files from a different directory (we would also have to copy those files during build to this directory), Twill is still expecting them to be inside
    /public
    , and we are also looking to do something simpler. Any ideas? Cheers!
  • i

    ifox

    06/22/2021, 6:41 PM
    @antonioribeiro I feel like a simple way would be to output our SVG sprites in a blade file and then including it instead of trying to load the SVG file itself
  • v

    vianney

    06/22/2021, 7:12 PM
    Is there a simple way to change the link for the CMS Users?
  • i

    ifox

    06/22/2021, 7:14 PM
    Hi @vianney what would you like to change? The label? The url?
  • v

    vianney

    06/22/2021, 7:14 PM
    the url
  • i

    ifox

    06/22/2021, 7:16 PM
    https://www.github.com/area17/twill/tree/2.x/views%2Fpartials%2Fnavigation%2F_user.blade.php
  • i

    ifox

    06/22/2021, 7:16 PM
    you'd need to override this view
  • v

    vianney

    06/22/2021, 7:17 PM
    oh sweet! that makes it easy
  • i

    ifox

    06/22/2021, 7:17 PM
    or, if you do not use the /admin/users route at all (I'm curious about your use case) you could setup a redirect on that url
  • v

    vianney

    06/22/2021, 7:18 PM
    yeah i was thinking of using an auto redirect or javascript if i was desperate, but it makes more sense to write over the file edit: we link out the users index to /admin/vendor/users Much appreciated!
  • i

    ifox

    06/22/2021, 7:18 PM
    great
  • i

    ifox

    06/22/2021, 7:19 PM
    interesting, what's vendor?
  • i

    ifox

    06/22/2021, 7:20 PM
    oh, you created a customer twill user module?
  • v

    vianney

    06/22/2021, 7:22 PM
    yup and something like that vendor would be like a Trainer/Guide that has subscriptions and they would have their own list of users that are related to that "vendor"
  • i

    ifox

    06/22/2021, 7:24 PM
    sounds cool
  • i

    ifox

    06/22/2021, 7:26 PM
    please share the project if you want/can in #811986244748705875 once it's live
  • d

    Dmi3yy

    06/23/2021, 10:08 AM
    media is support svg?
  • d

    Dmi3yy

    06/23/2021, 10:08 AM
    https://tppr.me/s30m1
  • u

    user

    06/23/2021, 10:20 AM
    hey @User I've got an issue on my production server related to sessions and cookies, I'm not sure if it's a twill problem, but it could be related to it. To cut the long story short, Laravel does not set XSRF token nor the _session cookie, but they are being set on the admin.domain.com, when moving to the domain.com I get a 'unexpectedly closed to connection' Error. It persists until I remove XSRF and _session cookie. Do you have any idea what might be the issue at hand?
  • i

    ifox

    06/23/2021, 10:20 AM
    Are you using Glide?
  • i

    ifox

    06/23/2021, 10:20 AM
    ok @User
  • i

    ifox

    06/23/2021, 10:21 AM
    closed connection does not seem related to the client session
1...313233...484Latest