After a while of working with Laravel and various MVC frameworks, I have found that there is a good bit of standard coding that goes into scaffolding applications. I'm not the first to think this either and there are many scaffold builders (I've even worked at building these myself too) and modified versions of the Laravel application skeleton. While these start up helpers are a great help for creating quick small applications, they quickly become overwhelmed by larger applications. On top of this, many of them take on pretty strong conventions and coding patterns. There are a few things that I've been wanting from a startup tool that I just have not been able to find.
Easily Updated When working with something to start up applications quickly, I want to be able to keep up to date with the latest development. I understand that having a scaffold based on a VCS system allows you to pull from an upstream remote, but this quickly breaks down and I'd really rather not have to work out merge conflicts all the time. What's great is that composer gives us a great way to keep things up to date without having to worry about merge conflicts.
Opt-In, Opt-Out A scaffolding utility shouldn't force me into sticking with their implementation the whole time. If I want to swap in my own implementation of a login controller, I should be able to overwrite one thing or another.
Customizable When starting out an app, it's great to use a standardized bit of bootstrap code and some standard views, but changing out my own view shouldn't mean that I have to pull out of the scaffolding utility. Moving on, I should be able to overwrite things, change out properties and change out functionality slowly as the application grows.
Should work outside of basic MVC Once an application grows out of the standard MVC pattern, I find that most of the scaffold utilities have to be yanked out or modified to the point where they have barely saved me time. I should be able to keep using my scaffolding utility in my larger more complicated applications just as much as my smaller applications.
It's a tall order of todos, and there hasn't really been a solution that eloquently solves all of the problems while remaining thin and staying out of the way as an app grows.
My Solution
App Toolkit is my go at solving this problem. It started initially as a scaffolding utility for creating sub-applications. Then I decided that App Toolkit would become a collection of packages that make scaffolding a new Laravel app of any size a breeze.
The Implementation
Given the requirements I have set out for myself, it seems like the best solution would be a collection of traits and abstract classes that allow fragments of common code to be quickly dropped into an app and save tons of time.
On top of this, the traits and abstract classes should use a good deal of properties to allow for customization.
Then, there should be a collection of views to start things out quickly, preferably using Bootstrap or Gumby or the sorts to help make things pretty to start.
Finally, there should be a collection of common migrations that can be published into your migrations folder instead of having to call art migrate --package xxx
on your serve too.
Progress So Far
Currently, the App Toolkit has a basic implementation of the sub-app scaffolder, the migration publisher, and a common bunch of traits to help build a rather useful User model by simply including one line:
use Rtablada\AppToolKit\User\BaseModel;
Rewrite To Come
While the app scaffolder and migration publisher are functional, they do not allow for options and customization as I would like. For the scaffolder, I would like to have options to specify whether to scaffold filters, routes, controllers, etc. For the migration publisher, I hope to add the ability to specify a single migration to publish from a package instead of having to publish all of the migrations.
Future Features
Coming up next, I hope to create a set of traits to help deal with common user functions including:
- Logging In
- Logging Out
- Resetting Passwords
From there, I would like to create a quick way of creating controllers for building secure CRUD forms. While this will require the building of a form view and the setting of a few properties, I think that it will still be faster than building out specific controllers for each one.
A Group Of All My Packages
Eventually, I hope that App-Toolkit will be a collection my packages that I (and the community) use the most. This will not only aid in having to only require one package, but it also will help me deal with issues faster since everything will be in one place.
However, at the same time, I will hopefully set up git subsplits to make it so that packages such as package-installer, migration-publisher, application-builder, and one other thing that I have up my sleeve can all be installed alone instead of only as a part of App Toolkit.