Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standards and Defaults #9

Open
mwaa opened this issue Jul 29, 2016 · 1 comment
Open

Standards and Defaults #9

mwaa opened this issue Jul 29, 2016 · 1 comment
Assignees
Milestone

Comments

@mwaa
Copy link

mwaa commented Jul 29, 2016

This is related to rest-ful flags issue #7

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
@samuelkubai samuelkubai added this to the v1.0 milestone Aug 22, 2016
@samuelkubai samuelkubai self-assigned this Aug 22, 2016
@ralphowino ralphowino locked and limited conversation to collaborators Aug 23, 2016
@samuelkubai
Copy link
Contributor

@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 free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants