php - ReflectionException error when setting up my own library in Laravel -
i laravel newbie. i'm following tutorial sets custom library verify forms. directory structure setup this:
lara ----->app----->acme----->services ----->validators ----->bootstrap ----->public ----->vendor
i error: reflectionexception class acme\services\tasksvalidator not exist
i suspect it's in taskcontroller starts this:
<?php use \acme\services\taskcreatorservice; class taskscontroller extends basecontroller{ protected $taskcreator; public function __construct(taskcreatorservice $taskcreator){ $this->taskcreator = $taskcreator; } public function index(){ $tasks = task::with('user')->get(); $users = user::lists('username', 'id');
what doing wrong? i've added following in composer.json under autoload
"psr-0":{ "acme":"app/" }
i've run: composer dump-autoload -o
my taskcreatorservice file begins this:
<?php namespace acme\services; use acme\validators\taskvalidator; use acme\validators\validationexception; use task; class taskcreatorservice{ protected $validator;
you requiring
use acme\validators\taskvalidator;
and using in class:
\acme\services\tasksvalidator (with s)
Comments
Post a Comment