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

    user

    07/07/2021, 2:43 PM
    Ok, my other doubts are:
  • u

    user

    07/07/2021, 2:44 PM
    protected $moduleName = 'projects'; - I created a new project, is it anyway that this can be loaded from database
  • u

    user

    07/07/2021, 2:44 PM
    so I maintain modules table... name, route_path, is_enabled, etc... then I can dynamically load in the controller... and pass it on to the views...
  • u

    user

    07/07/2021, 2:46 PM
    Because then I can enable a specific module for specific sites; Secondly, If I add project_types controller or categories controller... do I have to use [ php artisan twill:module categories] - I want to package all controllers related to projects as one package...
  • p

    pboivin

    07/07/2021, 2:49 PM
    On the frontend (ie. the public pages of your site), you can simply query your models as in standard Laravel, eg.
    Project::where(['priority' => 1])->get()
    etc.
  • u

    user

    07/07/2021, 2:49 PM
    Okay
  • p

    pboivin

    07/07/2021, 2:52 PM
    Yeah, my preference is to lean on modules a lot and "model" my solutions around multiple modules. I would totally go for "projects" and "categories" as modules.
  • u

    user

    07/07/2021, 2:53 PM
    I created the projects - but it is not showing on the Admin Menu
  • u

    user

    07/07/2021, 2:54 PM
    so I added this in twill-navigation => 'projects' => [ 'title' => 'Projects', 'module' => true, ],
  • u

    user

    07/07/2021, 2:54 PM
    Route::module('projects'); - in admin.php
  • p

    pboivin

    07/07/2021, 2:55 PM
    Looks good, still not working? Also, did you run your migrations?
  • u

    user

    07/07/2021, 2:55 PM
    and created index.blade.php under views/admin folder
  • p

    pboivin

    07/07/2021, 2:56 PM
    Shouldn't be necessary for now
  • u

    user

    07/07/2021, 2:56 PM
    Ooops.. I forgot to run migrate... did now
  • u

    user

    07/07/2021, 2:56 PM
    But still got this error: Symfony\Component\Routing\Exception\RouteNotFoundException Route [admin.projects.index] not defined.
  • p

    pboivin

    07/07/2021, 2:57 PM
    double-check your
    routes/admin.php
    ... eg. did you save it?
  • u

    user

    07/07/2021, 2:59 PM
    This is admin.php
  • u

    user

    07/07/2021, 2:59 PM
    <?php use Illuminate\Support\Facades\Route; // Register Twill routes here eg. // Route::module('posts'); Route::module('projects');
  • p

    pboivin

    07/07/2021, 3:03 PM
    Strange... what if you
    dd
    something from this file, eg.
    Copy code
    dd("HELLO");
    Route::module('projects');
    Do you see the message when you refresh?
  • u

    user

    07/07/2021, 3:04 PM
    No i don't see any message
  • p

    pboivin

    07/07/2021, 3:04 PM
    What is the full path to this
    admin.php
    file you are editing?
  • u

    user

    07/07/2021, 3:05 PM
    But if I remove the code from twill-navigation, then it is okay
  • u

    user

    07/07/2021, 3:05 PM
    This is from twill-navigation.php
  • u

    user

    07/07/2021, 3:05 PM
    <?php return [ 'projects' => [ 'title' => 'Projects', 'module' => true, ], ];
  • u

    user

    07/07/2021, 3:06 PM
    routes/admin.php - this is the full path
  • p

    pboivin

    07/07/2021, 3:07 PM
    Hmmmmm. Are you using
    'support_subdomain_admin_routing' => true,
    ?
  • u

    user

    07/07/2021, 3:07 PM
    where is this ... in .env file?
  • u

    user

    07/07/2021, 3:08 PM
    http://townhouse.test:8080/admin - my admin url is not sub-domain based...
  • p

    pboivin

    07/07/2021, 3:09 PM
    This would be in your
    config/twill.php
    . Sorry, let's scratch this one, I thought you wanted to setup multiple subdomains.
  • u

    user

    07/07/2021, 3:11 PM
    config/twill.php is blank now
1...525354...484Latest