How to make a Trait in Laravel

前端 未结 3 2027
轻奢々
轻奢々 2021-01-31 15:08

Where to make the file if i want to use this trait on my Models

How should this file look like if i want to have this trait inside:

trait FormatDates
{
          


        
3条回答
  •  广开言路
    2021-01-31 15:41

    Using this package you can create create Repository, Repository with Interface, Service, Trait form command line using php artisan command.

    composer require theanik/laravel-more-command --dev

    For create trait

    php artisan make:trait {Trait Name}

    Git repo : https://github.com/theanik/laravel-more-command

提交回复
热议问题