You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider having defaults for controller when init is done
/**
* TaskController constructor.
* @param BaseRepository $repository
* @param TaskTransformer $transformer
* Transformers are used to convert model to json, with fields we would like to show.
* BaseRepository contains all logic used to manipulate the database you can override this with
* repository class you wish to have.
*/
public function __construct(BaseRepository $repository, TaskTransformer $transformer)
{
$this->repository = $repository;
$this->transformer = $transformer;
}
The reason for this is to properly guide user on the next step of things they need to do. Without proper knowledge of existing functionality. User does not know that with the current generated controller classes (that are using the resourceful trait) they are supposed to initialize some properties.
Ideally we can also comment out the constructor functionality and instead add TODO:: comment that alerts the user to either un-comment lines or delete if they are not using constructor.
Suggestion to use the TODO:: comments across file generation to properly guide use on list of things they need to setup/override if they desire
Note that using base-repository provides all existing functionality for standard database manipulation and users should be made aware of what the repository has to offer.
Interfaces generated repositories should automatically implement companion interface. with starter:init the generated BaseRepository does not implement BaseInterface. Also confirm that when generating new Repository companion interface is created.
Binding user needs to be made aware that for all repositories they need to bind create bindings for the repository. Inside the function register in App\Providers\ServiceProviders they should add the line(s) $this->app->bind(BaseInterface::class, BaseRepository::class);
Folder Structure especially for models disrupts defaults for laravel. Its worth pointing out that users should do a search and replace to reference new paths i.e App\User::class should become App\Models\User::class. For any generation that would override Laravel defaults notify user of the changes first before they encounter errors.
*Env variables * api helper depends on dingo/api for api routes and jwt/auth for authentication. However, its not mentioned to the user on how to modify environment variables to reflect the configuration of this 2 packages. Its worth noting down essential keys to include in .env file
The text was updated successfully, but these errors were encountered:
@mwaa I think we will first focus on creating the repositories and educating the users on that before trying to add the accompanying interfaces for the repositories.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This is related to
rest-ful
flags issue #7Consider having defaults for controller when init is done
The reason for this is to properly guide user on the next step of things they need to do. Without proper knowledge of existing functionality. User does not know that with the current generated controller classes (that are using the resourceful trait) they are supposed to initialize some properties.
Ideally we can also comment out the constructor functionality and instead add
TODO::
comment that alerts the user to either un-comment lines or delete if they are not using constructor.TODO::
comments across file generation to properly guide use on list of things they need to setup/override if they desireApp\Providers\ServiceProviders
they should add the line(s)$this->app->bind(BaseInterface::class, BaseRepository::class);
App\User::class
should becomeApp\Models\User::class
. For any generation that would override Laravel defaults notify user of the changes first before they encounter errors.The text was updated successfully, but these errors were encountered: