Skip to content
Advertisement

use multiple Trait in laravel Controller

problem in use multiple Trait in Controller

Traits

JavaScript

in CRController

JavaScript

error log

JavaScript
JavaScript

exec command…

composer dump-autoload

composer dump-autoload -o

php artisan config:clear

php artisan view:clear

php artisan route:clear

php artisan cache:clear

not wotking!

Advertisement

Answer

This is called Conflict Resolution. In a simple terms, you need to select a default name method so to speak.

To resolve naming conflicts between Traits used in the same class, the insteadof operator needs to be used to choose exactly one of the conflicting methods.

All you need to need is to use A::name instead of the others. and define another names for the other trait methods.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement