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

    void

    07/10/2021, 4:34 PM
    I'm gonna leave it at that as it is not Twill specific and as I said that rabbit hole can go as deep as you want.
  • u

    user

    07/10/2021, 5:23 PM
    Thanks @void Appreciate your time and help. Have moved on to another package.. tenancyforlaravel... lets hope that works out. Thanks again. 👍
  • l

    Luís Novais

    07/11/2021, 4:43 PM
    How can I change the section name from "CONTENT" to other name ?
  • l

    Luís Novais

    07/11/2021, 4:43 PM
    and have multiples sections inside the same form ?
  • p

    pboivin

    07/11/2021, 4:47 PM
    @User You can change the "Content" label by passing a variable to the form layout: @extends('twill::layouts.form', [ 'contentFieldsetLabel' => "Hello World" ])
  • p

    pboivin

    07/11/2021, 4:48 PM
    Have a look at the form fields section of the docs. The second example is about setting up multiple fieldsets :
  • p

    pboivin

    07/11/2021, 4:48 PM
    https://twill.io/docs/#form-fields
  • l

    Luís Novais

    07/11/2021, 4:48 PM
    thanks for your help
  • l

    Luís Novais

    07/11/2021, 4:49 PM
    thanks for you help
  • l

    Luís Novais

    07/11/2021, 11:32 PM
    in browser is possible remove max values ?
  • v

    void

    07/12/2021, 10:11 AM
    hmm my Repeater field shows records that have been deleted (deleted_at != null)
  • i

    ifox

    07/12/2021, 10:49 AM
    @void make sure the repeated model is soft deletable
  • i

    ifox

    07/12/2021, 10:50 AM
    it would be if it inherited Twill's model
  • b

    Bubumeister

    07/12/2021, 12:22 PM
    Hi, just saw when deleting a model the related blocks (from block-editor) wont get deleted. Shouldnt that be handled by the hasBlocks-Trait?
  • b

    Bubumeister

    07/12/2021, 12:27 PM
    Or is there something i have overlooked?
  • p

    pboivin

    07/12/2021, 12:52 PM
    Hey @User, that's right, I think you found a bug!
  • p

    pboivin

    07/12/2021, 12:56 PM
    As a quick fix, you could hook into your model's
    deleted
    event to clean up your blocks : https://laravel.com/docs/8.x/eloquent#events
  • b

    Bubumeister

    07/12/2021, 1:46 PM
    👍 Thanks!
  • b

    Bubumeister

    07/12/2021, 1:49 PM
    Btw. Model-events dont work in Eloquent-Queries (as in ModuleRepository.bulkForceDelete). So i maybe just hook into afterDelete()
  • v

    void

    07/12/2021, 1:59 PM
    True it was extending Eloquent instead of Twill's Model, thanks
  • b

    Bubumeister

    07/12/2021, 2:31 PM
    @User Any reasons why forceDelete (https://github.com/area17/twill/blob/2.x/src/Repositories/ModuleRepository.php#L436) is not more similar to delete() so one can use Model-events?
  • p

    pboivin

    07/12/2021, 2:33 PM
    I believe
    forceDelete()
    is coming from Laravel's
    SoftDeletes
    trait, not Twill
  • p

    pboivin

    07/12/2021, 2:35 PM
    Scratch that, I guess I'm not awake 🙂
  • p

    pboivin

    07/12/2021, 2:39 PM
    Ok, correct me if I'm wrong but you should be able to hook on to
    forceDeleted
    event from
    SoftDeletes::forceDelete()
    , no?
  • p

    pboivin

    07/12/2021, 2:40 PM
    https://github.com/laravel/framework/blob/8.x/src/Illuminate/Database/Eloquent/SoftDeletes.php#L54
  • b

    Bubumeister

    07/12/2021, 3:12 PM
    Does not work when using DB:query as in bulkForceDelete. Only when using Models events are fired. So it would be better to also use Models in bulkForceDelete, i think. For my use-case i overrid the method and its working like it should now.
  • b

    Bubumeister

    07/12/2021, 3:13 PM
    But i omit the isTrashed-condition which is ok for me
  • p

    pboivin

    07/12/2021, 3:17 PM
    Ah I see, yes, the events aren't fired for bulk queries. Not sure about the original reasoning behind this but I believe it has to do with avoiding N
    delete
    queries to the database. Does that make any sense?
  • b

    Bubumeister

    07/12/2021, 3:25 PM
    🤷 😄 Nevermind, thanks for your help! Appreciate that!
  • i

    ifox

    07/12/2021, 3:59 PM
    @Rudy when are you getting this error? while saving?
1...606162...484Latest