cannot use class because it is not a trait

后端 未结 2 1894
野性不改
野性不改 2021-02-19 11:57

I have followed the tutorial here on building a validation service for laravel. I am having issues now when trying to call the validator from one of my controllers. I am seeing

相关标签:
2条回答
  • 2021-02-19 12:25

    Your 'use' statement should be above the class definition of validController

    0 讨论(0)
  • 2021-02-19 12:31

    Try putting the use before the class declaration:

    <?php // namespace Portal\Controllers;
    
    use \Portal\Service\Validation\Laravel\AppInstancesValidator;
    
    class validController extends BaseController {
    
        public function validateInstance() {}
    
    }
    
    0 讨论(0)
提交回复
热议问题