how to create trait and whats the benefits and use

 create folder trait

Trait nameoftrait{

}


class MyClass {

    use MyTrait;

    

    // Class methods and properties

}




multiple inheritance
use controller -> single inheritance
traits multiple inheritance
reusable of code
duplication of code removes


No comments:

Post a Comment

server laravel application

 asset_url = domain/public chmod -R 755 public/admin/ composer dump-autoload get the application from hostinger