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

    Harings Rob

    09/07/2022, 8:21 AM
    But that should not be too hard so it can be done using a config in 3.x
  • h

    Harings Rob

    09/07/2022, 8:21 AM
    Can you make a feature request for it?
  • t

    thingasd

    09/07/2022, 8:43 AM
    @Harings Rob Thanks for your quick response! I just created a feature request. https://github.com/area17/twill/issues/1800
  • m

    mateoD

    09/07/2022, 1:05 PM
    hello, do you know if there is a way to link each element of the relation column with the destination link
    Copy code
    protected $indexColumns = [
            'services' => [ // relation column
                'title' => 'Services',
                'relationship' => 'services',
                'field' => 'title',
            ],
        ];
  • s

    Shiftless

    09/07/2022, 8:53 PM
    i think you should use a presenter in this case. That than presents the column with html
  • m

    mateoD

    09/07/2022, 9:39 PM
    can you give me any examle how to use it in my example protected $indexColums ? @Shiftless
  • k

    kalle

    09/07/2022, 9:53 PM
    https://spectrum.chat/twill/help/could-somebody-explain-what-is-presenter-in-twill~6741f3bc-4ce6-48a5-a6ca-7b5b78475764#:~:text=%2C%20a%20presenter%20in%20Twill%20is,%24presenter%20and%20%24presenterAdmin%20properties.
  • s

    Shiftless

    09/07/2022, 10:43 PM
    @kalle was faster. important ist that the presenter function name is the index column field name.
  • m

    MedvedOurs

    09/08/2022, 9:23 AM
    Hello! I'm trying to update to Twill 2.8, and it works fine on local. On prodution however I get the following js error:
    window.TWILL.STORE.config is undefined
    Any idea?
  • d

    dedli

    09/08/2022, 9:33 AM
    Hi guys ) I have Parent-child module. My child module page has revisions. Save and preview of revisions works fine without any problem. But when I try to restore previous revision I get 404 error (The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved.). My link is /admin/category/personalCategories/personalPages/restoreRevision/14?personalCategory=2&personalPage=14?revisionId=2925. I think there is some problem in this url. Maybe somebody know why I have this error and how to fix it? Thanks
  • i

    ifox

    09/08/2022, 9:57 AM
    Hi @dedli https://github.com/area17/twill/issues/302
  • h

    Harings Rob

    09/08/2022, 10:08 AM
    @MedvedOurs make sure that your assets are available on production server.
  • d

    dedli

    09/08/2022, 11:14 AM
    Thanks, but as I see I have all this conditions: my admin routes file is:``` Route::group(['prefix' => 'category'], function () { Route::module('personalCategories.personalPages'); });
    Copy code
    in my PersonalCategoriesPersonalPagesController:
    protected $moduleName = 'personalCategories.personalPages'; protected $modelName = 'PersonalPage'; protected $previewView = 'page.show'; ``` And I can see all previous revisions and can preview it. My problem only when I try to restore one of my revisions. Maybe problem is that this modules live inside admin menu item "category"? And I have two questions sign in url /admin/category/personalCategories/personalPages/restoreRevision/14?personalCategory=2&personalPage=14?revisionId=2925
  • s

    Sami

    09/08/2022, 12:31 PM
    Hello, I'm trying to setup custom role in Twill but I can't get composer to exclude
    \A17\Twill\Models\Enums\UserRole.php
    and use
    App\Models\Enums\UserRole
    My
    composer.json
    autoload config:
    Copy code
    json
    "autoload": {
            "files": ["app/Models/Enums/UserRole.php"],
            "exclude-from-classmap": ["vendor/area17/twill/src/Models/Enums/UserRole.php"],
            "psr-4": {
                "App\\": "app/",
                "Database\\Factories\\": "database/factories/",
                "Database\\Seeders\\": "database/seeders/"
            }
        },
        "autoload-dev": {
            "files": ["app/Models/Enums/UserRole.php"],
            "exclude-from-classmap": ["vendor/area17/twill/src/Models/Enums/UserRole.php"],
            "psr-4": {
                "Tests\\": "tests/"
            }
        },
    and result in `composer.lock`:
    Copy code
    json
    "autoload": {
        "psr-4": {
            "A17\\Twill\\": "src/"
        }
    },
    I don't know what I'm doing wrong here 😅
  • k

    kalle

    09/08/2022, 12:34 PM
    Try
    composer dump
    it will recreate the autoload files.
  • s

    Sami

    09/08/2022, 12:36 PM
    not working, I get
    No static method or enum constant 'PLEB' in class A17\Twill\Models\Enums\UserRole
    . Also composer.lock stays the same
  • k

    kalle

    09/08/2022, 12:45 PM
    Yeah, cuz custom
    app/Models/Enums/UserRole.php
    is not loaded. Do you have this file in your project? I have the same use case in my current project and its same as yours (only I load file after
    psr-4
    key) and its working fine. Which Twill version do you use?
  • s

    Sami

    09/08/2022, 12:47 PM
    yes, I believe I do have the file Twill 3.0.0-alpha1
  • k

    kalle

    09/08/2022, 12:56 PM
    Really I dont understand what is wrong here, it should work. You can try to bind other custom enum class to Twill one.
    Copy code
    php
    
    use App\Models\Enums\UserRole as CustomRole;
    use A17\Twill\Models\Enums\UserRole;
    
    
    class AppServiceProvider extends ServiceProvider
    {
        /**
         * Register any application services.
         *
         * @return void
         */
        public function register()
        {
            $this->app->bind(UserRole::class, CustomRole::class);
        }
  • s

    Sami

    09/08/2022, 1:01 PM
    I guess today is not my lucky day. Doesn't work either
    k
    i
    h
    • 4
    • 18
  • d

    dedli

    09/08/2022, 4:04 PM
    @ifox could you help me with this, please
  • h

    Harings Rob

    09/09/2022, 7:35 AM
    Hey @dedli if you can make a small repo where the issue can be reproduced I can work out a fix.
  • d

    dedli

    09/09/2022, 8:28 AM
    thanks a lot! Send personal message to you.
  • m

    Mentally

    09/09/2022, 9:50 AM
    oi oi i need to add icons to navigation menu. can somebody point me in the right direction ? P.S. i dont know if i asked this question i right way
  • i

    ifox

    09/09/2022, 9:59 AM
    Hey, you did, no worries. It is not supported by default but still possible, let me see if I can find a reference
  • i

    ifox

    09/09/2022, 10:05 AM
    At the moment you would need to override this partial in your application to add icons to navigation items: https://github.com/area17/twill/blob/2.x/views/partials/navigation/_global_navigation.blade.php
  • h

    Harings Rob

    09/09/2022, 10:15 AM
    I added a feature request for it as well: https://github.com/area17/twill/issues/1808
  • h

    Harings Rob

    09/09/2022, 10:17 AM
    If you are on twill 3.x, with a soon to be merged pr you could also introduce your own "menulink" component and add the icon like that.
    TwillNavigation::addLink(MyCustomLinkComponent::make()->...)
  • d

    delta107

    09/10/2022, 12:42 PM
    Hi! Have you noticed issues when using twill with a mysql db that replicates? Specifically regarding primary keys, I noticed for example the related table in one of my projects lacks primary keys, then I read on stackoverflow that lack of primary keys can create issues in a mysql replication cluster
  • d

    delta107

    09/10/2022, 12:46 PM
    https://stackoverflow.com/a/71075865/19309381
1...386387388...484Latest