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

    dedli

    07/04/2022, 10:11 AM
    Thanks, I will try )
  • d

    dedli

    07/04/2022, 10:13 AM
    Hi @ifox, is it right?
  • i

    ifox

    07/04/2022, 10:13 AM
    Yes @dedli
  • d

    dedli

    07/04/2022, 10:13 AM
    Thanks
  • i

    Ian.H

    07/04/2022, 10:13 AM
    Hi all.. I know this issue has been raised multiple times in various places on the interwebs.. but alas, nothing appears to resolve this for me. Whenever I try to access the
    /admin
    route (or any sub-route of that) I get a 404. I'm running this in a
    docker-compose
    environment (locally at this point) using
    PHP-FPM
    (7.4.30) and
    nginx
    (latest). I've added nothing but a clean
    Laravel 7.30
    project and
    twill:2.1.1
    (version is specific as this is what's running in a project I've been handed). I've run the
    twill:install
    command and registered myself as a super admin. My relevant
    .env
    vars are:
    Copy code
    APP_URL=twill.test:8001
    ADMIN_APP_URL=twill.test:8001
    ADMIN_APP_PATH=admin
    As far as I'm aware, I've done everything in the docs for install and config required for the most base-level install. The admin etc routes are all listed when running
    php artisan routes:list
    so they appear to have been registered. My
    nginx
    config is (which is my generic one I use.. works fine for the likes of Livewire, Fillament, Nova, etc):
    Copy code
    server {
        listen 80 default;
    
        client_max_body_size 108M;
    
        access_log /var/log/nginx/application.access.log;
    
    
        root /application/src/public;
        index index.php;
    
        if (!-e $request_filename) {
            rewrite ^.*$ /index.php last;
        }
    
        location ~ \.php$ {
            fastcgi_pass twill-php:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log";
            fastcgi_buffers 16 16k;
            fastcgi_buffer_size 32k;
            include fastcgi_params;
        }
    }
    If anyone has a clue regarding this (I suspect it's nginx-related) I'd be most grateful in hearing 🙂
  • i

    Ian.H

    07/04/2022, 10:15 AM
    Reason I suspect nginx for this... if I use xdebug to break the Twill
    RouteServiceProvider
    constructor, nothing hits when accessing the
    /admin
    URI, but it does when I do a
    route:list
    call, but couldn't find anything specific to nginx requirements in the docs or the likes
  • i

    ifox

    07/04/2022, 10:18 AM
    hi @Ian.H this is not a problem with your NGINX config, try omitting the port from your
    ADMIN_APP_URL
  • i

    ifox

    07/04/2022, 10:20 AM
    not related to your issue but wanted to let you know running twill:install is not something you want to run on an existing Twill project as it in an initialization command when first installing Twill into a project.
  • i

    Ian.H

    07/04/2022, 10:49 AM
    Many thanks @ifox ! I'm assuming there's no easy way to run twill using a custom port? (this is for the dev environment where I have multiple projects/services running). Thanks for the install tip too. I only ran this this time as everything was a clean install. In the project I've inherited, it's already been up and running for the past 12 months or so.. but I'm in the process of building out a uniform dev environment (rather than the homestead, valet, MAMP systems the devs are currently using in my team). My test project is now accessible when removing the port number.. so many thanks for that.. much appreciated!
  • h

    Harings Rob

    07/04/2022, 4:17 PM
    hey @Ian.H, I am pretty sure we can make that work, but not that high of a priority.
  • i

    ifox

    07/04/2022, 5:15 PM
    it should already work actually. Making sure @Ian.H you just removed it from admin_app_url but are still accessing it on the port and it works? Or did you have to run your container on port 80?
  • i

    Ian.H

    07/04/2022, 9:07 PM
    @Harings Rob @ifox thanks for the responses to this, again appreciated. I was going to look into creating a PR to do it, but as it happens, it does seem to work if you just remove the port from the
    admin_app_url
    (at least the login page shows). Wonder if this would have issues deeper in (as Laravel itself does) with certain aspects that use that env var for setting things (IIRC, Laravel uses it for example for asset loading and maybe redirects too? has been a long time since I've not set it up to match my actual URLs). It's something I'll try out as I go with building this environment for the team and if it is something that's needed later, happy to contribute a PR 🙂
  • j

    JeanSilva

    07/04/2022, 9:40 PM
    hi! is there a way to add new actions to a row in the admin module lists? a new option like these:
  • i

    ifox

    07/05/2022, 12:11 AM
    @JeanSilva not without custom vue components, but that is something coming later in Twill 3
  • d

    dakaalim

    07/05/2022, 12:52 AM
    I went
    Copy code
    Do you need to manage the position of records on this module? [yes]:
      [0] no
      [1] yes
     > 1
    1
    But the generated class is missing
    Copy code
    protected $indexOptions = [
    'reorder' => true,
        ];
  • i

    ifox

    07/05/2022, 12:54 AM
    @dakaalim good point. when responding yes to the nesting question, it does it, so we should also do it for this question
  • h

    Harings Rob

    07/05/2022, 6:18 AM
    I worked on this a bit before. I think I had to revert a bit of it. https://github.com/area17/twill/commit/49368dad98ff16b6e2c73373690a51415306abaa
  • h

    Harings Rob

    07/05/2022, 6:19 AM
    It had regressions so that's why I had to remove it.
  • i

    Ian.H

    07/05/2022, 7:54 AM
    Thanks for the pointer to previous efforts.. that's very interesting. I've just had a look through the issue raised regarding the change and the result. I'll certainly consider options with this hopefully propose something. This is my first venture into using Twill, but we use it quite heavily at Spitfire Audio where I've just joined. It'd be good to get this worked out if possible.... something for the weekend, as they say 🙂
  • u

    24kappa

    07/05/2022, 9:03 AM
    Hi, is possible to add a new package dependency for admin assets? (
    vendor/area17/twill/package.json
    ) I would like to add Vuetify library to some custom components in the backend, on my fronted side I'm using vue3 which does not support vuetify so if
    npm install vuetify --save
    it has conflicts with the
    package.json
    in the root of the project. Any idea on how i can do that?
    i
    • 2
    • 3
  • d

    dedli

    07/05/2022, 10:16 AM
    Hi ) It is any build in methods/solutions for global site search for frontend? And is it build in methods/solutions for search in one certain module? Thanks for help
    i
    • 2
    • 4
  • i

    ifox

    07/05/2022, 10:22 AM
    custom dependencies conflicts
  • j

    JeanSilva

    07/05/2022, 12:29 PM
    thanks for answering. 🤔 I need to customize some module listings in a project using twill. In this project it has a backend only with admin + api that feeds a frontend project only. Because of this, whenever an admin creates a new element (lets say, a product) and publishes it, they can access the url using the slug (the frontend), but it doesn't have a "view" button in the admin listing to show the new created product. Is there a way to put a link somewhere in the listings? Like, if I have a Product 1, then in the same row, an external link to something like site/product/product-1 ? I was trying to fiddle with the title and getting errors. I'm beginner with twill.
  • i

    ifox

    07/05/2022, 12:31 PM
    yes you can totally add a column with a link, by using
    $indexColumns
    with a model accessor or presenter. There's an
    html
    boolean you can use in your column definition to make sure it'll render a link.
  • j

    JeanSilva

    07/05/2022, 12:34 PM
    thanks for the help, I'll try it out 😄
  • d

    dedli

    07/05/2022, 6:07 PM
    Hi again ) I set
    Copy code
    protected $previewView = 'page.show';
    to my admin controller but I get error when I try to preview. Some modules show preview, some not and I cannot understand why https://monosnap.com/file/ZIixkuYejHTv8eQ4ukCmmfbnSGoGh6
  • d

    dedli

    07/05/2022, 6:11 PM
    Modules that does not show preview not in the root in admin, maybe this is a problem. If so, how should I config preview routes?
  • i

    ifox

    07/05/2022, 6:52 PM
    I don't think that's the problem. Are these routes/view working fine in the frontend?
  • j

    JeanSilva

    07/05/2022, 7:29 PM
    thanks for helping @ifox it worked
  • j

    JeanSilva

    07/05/2022, 7:30 PM
    but I have another question for you guys 😅. To use the duplicate function/action, it seems I need to use the HasRevisions trait, is that so?
1...355356357...484Latest