Albert
TCTwill CMS
•Created by Albert on 10/21/2024 in #👊support
how to override a default database model class method
@ifox which means models config feature is available from version 3 and not in version 2 !!! Or its available in version 2, but media model is not configurable at the moment? if so what all models supported?
19 replies
TCTwill CMS
•Created by Albert on 10/21/2024 in #👊support
how to override a default database model class method
Have you ever used config.models file?
19 replies
TCTwill CMS
•Created by Albert on 10/21/2024 in #👊support
how to override a default database model class method
@kallefrombosnia Thanks for the suggestion.
19 replies
TCTwill CMS
•Created by Albert on 10/21/2024 in #👊support
how to override a default database model class method
I am using twill 2 and soon will upgrade to 3. I have faced many challenges during the previous upgrade of twill. So looking for a elegant override mechanism for vue files, models, controllers, blade files, services, repositories
19 replies
TCTwill CMS
•Created by Albert on 10/21/2024 in #👊support
how to override a default database model class method
Hello Again,
A17\Twill\Models\Media model has scopeUnused method, I would like to override the same in my custom class
App\TwillOverrides\Models\Media which extends the base media class (Above mentioned class)
in app service provider
$this->app->bind(A17\Twill\Models\Media::class, App\TwillOverrides\Models\Media);
It works fine
From yesterday's conversation I have created a models config with the following content
'media' => \A17\Twill\Models\Media::class, But still it refers to the base class instead of override class. tried with the override class as well, but no luck 'media' => \App\TwillOverrides\Models\Media::class tried with clearing cache too, not sure what Im missing
'media' => \A17\Twill\Models\Media::class, But still it refers to the base class instead of override class. tried with the override class as well, but no luck 'media' => \App\TwillOverrides\Models\Media::class tried with clearing cache too, not sure what Im missing
19 replies
TCTwill CMS
•Created by Albert on 10/21/2024 in #👊support
how to override a default database model class method
Wow, great, thanks for the details.
Will it be same for A17\Twill\Repositories\BlockRepository as well?
19 replies
TCTwill CMS
•Created by Albert on 10/21/2024 in #👊support
how to override a default database model class method
I don't find models.block in twill config..
So I must mention the model name in the config, then extend the A17\Twill\Models\Block class to my custom class.
Can I place the custom class anywhere in the application?
19 replies
TCTwill CMS
•Created by Albert on 10/21/2024 in #👊support
how to override a default database model class method
@ifox
Block Eloquent model class
WIll add an additional method in it
19 replies
TCTwill CMS
•Created by Albert on 10/21/2024 in #👊support
how to override a default database model class method
DO we have any better approach?
Problem with current approach is updating twill from 2 to 3 is too difficult.
19 replies