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

    Rayderxx

    07/21/2021, 9:06 AM
    https://github.com/area17/twill/blob/30f296a859cfc394111199efd9491798b7d447f8/src/Services/Capsules/HasCapsules.php#L29
  • r

    Rayderxx

    07/21/2021, 9:07 AM
    why there is no array_merge with the default list data ?
  • r

    Rayderxx

    07/21/2021, 9:09 AM
    if I want to override a default namespace in a capsule module I have to set the property loaded to true and override all the default configuration myself its a little bit too much no ?
  • i

    ifox

    07/21/2021, 9:19 AM
    yes, I agree. @antonioribeiro any reason behind this?
  • l

    Luís Novais

    07/21/2021, 1:35 PM
    I guys, I can't create cms user if I don't put email settings for send email ?
  • p

    pboivin

    07/21/2021, 1:37 PM
    You can set the
    log
    email driver in your
    .env
    if you are just testing... the emails will arrive in
    laravel.log
  • p

    pboivin

    07/21/2021, 1:37 PM
    with the confirmation links
  • l

    Luís Novais

    07/21/2021, 1:38 PM
    Ok I will test that, thanks
  • l

    Luís Novais

    07/22/2021, 12:13 AM
    Hi guys, If I use position, the position is saved in database but in model list items the order keep equals after refresh the page, what I'm doing wrong ?
  • i

    ifox

    07/22/2021, 10:10 AM
    Hi @Luís Novais, do you mean on a module listing page or in a browser field?
  • l

    Luís Novais

    07/22/2021, 10:18 AM
    In de module listing page
  • i

    ifox

    07/22/2021, 10:31 AM
    ok! does your model have HasPosition as well as the sortable interface? and do you have 'reorder' at true in your controller's $indexOptions?
  • l

    Luís Novais

    07/22/2021, 4:39 PM
    Yes I have that I can reorder, and show the success message and in the database the position update, in the frontend I can get ordered list too, just in de model index list don't work
  • p

    pboivin

    07/22/2021, 4:47 PM
    @User in the module listing, what order are you seeing? Also can you click on a column (e.g Title) to reorder by that column?
  • i

    ifox

    07/22/2021, 5:03 PM
    a bit far fetched but what might be happening to you is stale local storage for that module
  • i

    ifox

    07/22/2021, 5:03 PM
    if that module was not sortable before and you have local storage data about sorting that list by another column than position, it might do that
  • p

    pboivin

    07/22/2021, 5:06 PM
    Another thought: Did you customize
    scopeOrdered()
    in your model?
  • l

    Luís Novais

    07/22/2021, 10:05 PM
    I just see the title column and I cant click for reador. Just have the dragger and title
  • i

    ifox

    07/22/2021, 10:16 PM
    @Luís Novais that makes sense and is correct when you enable the position management
  • i

    ifox

    07/22/2021, 10:17 PM
    what doesn't make sense is that it's not sorting them by position by default for you
  • i

    ifox

    07/22/2021, 10:17 PM
    Did you override defaultOrders in the controller? Could you check if the query does order by position?
  • i

    ifox

    07/22/2021, 10:18 PM
    and finally make sure to clear your local storage as I said above
  • l

    Luís Novais

    07/23/2021, 7:33 AM
    I have this: /** * Default orders for the index view. * * @var array */ protected $defaultOrders = [ 'position' => 'asc', ];
  • l

    Luís Novais

    07/23/2021, 7:33 AM
    nothing worked for now
  • l

    Luís Novais

    07/23/2021, 7:39 AM
    the $orders come empty in get function, if I force that for have ['position' => 'asc'] this works, why $orders come empty ?
  • i

    ifox

    07/23/2021, 8:52 AM
    you should not need to add a defaultOrders yourself
  • i

    ifox

    07/23/2021, 8:53 AM
    https://github.com/area17/twill/blob/4c3db071a4655cfb0cf5d4f5911521a3ccc255c8/src/Repositories/ModuleRepository.php#L62
  • i

    ifox

    07/23/2021, 8:53 AM
    If the model implements Sortable, Twill already does the right query
  • r

    Rayderxx

    07/23/2021, 9:31 AM
    @User 😥
  • a

    antonioribeiro

    07/23/2021, 10:35 AM
    @User @User , I don't really know the implications of a merge there, the list of capsules on config is supposed to be an on/off thing, and after the service provider is booted it's actually being replaced by the real list of capsules, with ALL information related to capsules. So we initially have this
    Copy code
    ['name' => 'Countries', 'enabled' => true],
    And then that array entry it's replaced by a list of this
    Copy code
    array:35 [▼
      "name" => "Countries"
      "enabled" => true
      "module" => "countries"
      "plural" => "Countries"
      "singular" => "Country"
      "base_namespace" => "App\Twill\Capsules"
      "namespace" => "App\Twill\Capsules\Countries"
      "database_namespace" => "App\Twill\Capsules\Countries\Database"
      "seeds_namespace" => "App\Twill\Capsules\Countries\Database\Seeds"
      "models" => "App\Twill\Capsules\Countries\Models"
      "model" => "App\Twill\Capsules\Countries\Models\Country"
      "repositories" => "App\Twill\Capsules\Countries\Repositories"
      "controllers" => "App\Twill\Capsules\Countries\Http\Controllers"
      "requests" => "App\Twill\Capsules\Countries\Http\Requests"
      "psr4_path" => "/Users/antonioribeiro/code/accor/food-and-beverage/app/Twill/Capsules/Countries"
      "base_path" => "/Users/antonioribeiro/code/accor/food-and-beverage/app/Twill/Capsules"
      "database_psr4_path" => "/Users/antonioribeiro/code/accor/food-and-beverage/app/Twill/Capsules/Countries/database"
      ...
    ]
    If you want to change this
    Copy code
    "namespace" => "App\Twill\Capsules\Countries"
    Maybe we should have a different array key for this and merge it, as, saying again, I don't know the implications of a merge, if we can just deep merge without loosing any data, I'm all for it!
1...666768...484Latest