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

    ifox

    08/30/2021, 12:34 PM
    @Shiftless you can use Laravel translation helpers from there
  • s

    Shiftless

    08/30/2021, 12:34 PM
    @User if i do so i get an error when i run
    php artisan config:cache
  • s

    Shiftless

    08/30/2021, 12:35 PM
    also the frontend does not render. 😦
    Uncaught ReflectionException: Class "view" does not exist in /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php:873
  • s

    Shiftless

    08/30/2021, 12:36 PM
    Copy code
    'globals' => [
            'title' => __('Globals'),
            'route' => 'admin.globals.contacts.index',
            'primary_navigation' => [
                'contacts' => [
                    'title' => 'Contacts',
                    'module' => true,
                ]
            ]
        ],
  • i

    ifox

    08/30/2021, 12:36 PM
    yeah if you need anything dynamic you'd need to set the config from a service provider instead of the config file itself
  • s

    Shiftless

    08/30/2021, 12:37 PM
    ah okay never did this. will try to find some explaination. Thank you for helping ❤️
  • s

    Shiftless

    08/30/2021, 1:17 PM
    okay i got the dynamic navigation config working. But why is the laravel trans function not taking my user set language into account?
  • i

    ifox

    08/30/2021, 2:19 PM
    ha, use
    twillTrans
    s
    • 2
    • 3
  • a

    afatmustafa

    08/31/2021, 12:55 AM
    Hi, I'm changing the default ordering like this but it does not change, where is the problem?
  • a

    afatmustafa

    08/31/2021, 12:55 AM
    result
  • a

    afatmustafa

    08/31/2021, 12:56 AM
    Also how can I edit the format of the date
  • g

    Ge1i0N

    08/31/2021, 6:03 AM
    Do you need to change the formatting of the date specifically in the database, or do you want to convert the date on output?
  • a

    afatmustafa

    08/31/2021, 6:04 AM
    On output
  • s

    Shiftless

    08/31/2021, 8:26 AM
    translation inside twill-navigation config
  • a

    afatmustafa

    08/31/2021, 4:57 PM
    I am waiting for your reply dear Ge1i0N
  • i

    ifox

    08/31/2021, 4:59 PM
    @afatmustafa you can use an accessor on your model or a presenter for this
  • a

    afatmustafa

    08/31/2021, 4:59 PM
    Do you have a link where I can get an example?
  • g

    Ge1i0N

    08/31/2021, 5:03 PM
    Sorry, I didn't see your message. I would recommend that you use Carbon. This will allow you to forma output as you need. https://carbon.nesbot.com/
  • a

    afatmustafa

    08/31/2021, 5:04 PM
    no problem thank you for your attention, but i know carbon, i need to add format here in $indexColumns = []
  • i

    ifox

    08/31/2021, 5:07 PM
    https://spectrum.chat/twill/help/carbon-date-on-indexcolumns~7b30b3b2-34e4-4d75-9b89-663d2f3f5fdc?m=MTU3NzExMzY5ODc3Nw==
  • a

    afatmustafa

    08/31/2021, 5:11 PM
    Thanks a lot ifox and Ge1i0N
  • a

    afatmustafa

    08/31/2021, 5:11 PM
    It works now
  • k

    Klief

    08/31/2021, 5:20 PM
    Hey! Quick question, am I supposed to add translatables both in the regular and _translations migration?
  • i

    ifox

    08/31/2021, 5:21 PM
    hey @User, no, only in _translations tables
  • k

    Klief

    08/31/2021, 5:21 PM
    Awesome, thanks!
  • k

    Klief

    08/31/2021, 6:36 PM
    How would I define a crop for a block? In the documentation it says in the "BlocksConfig", but where would that be? In the blade file?
  • i

    ifox

    08/31/2021, 6:40 PM
    in
    twill.php
    , under
    block_editor.crops
  • i

    ifox

    08/31/2021, 6:44 PM
    that documentation copy is now confusing because you don't need config for blocks anymore, we'll improve that
  • k

    Klief

    08/31/2021, 6:59 PM
    Ok! Thanks again for the quick reply 😃
  • a

    afatmustafa

    08/31/2021, 7:25 PM
    Hi guys i have another problem, there are only 2 data in the model, I create new item in the modal, but the image field work. It can be added normally.
1...818283...484Latest