Skip to content

chrispecoraro/mega-make

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 

Megamake for Laravel

Laravel's php artisan make: on steroids

artisan mega:make Department produces:

 /**
     * Display a listing of the Department resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(): ResourceCollection
    {
        return new DepartmentResourceCollection(Department::all());
    }

    /**
     * Store a newly created Department resource in storage.
     *
     * @param  \Illuminate\Http\Request $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request): Response
    {
        $input = $request->validate([
            // TODO
            // write validator
        ]);
        $department = Department::create($input->toArray());

        return response($department, 201);
    }

The mega:make artisan command creates most of the various pieces of a Laravel 5.5 entity, adding boilerplate code and //TODO's, giving you an extra boost, eliminating extra typing.

  • A Model
  • A Model Factory
  • A Seeder
  • A Migration
  • A Resource Controller
  • A Single API Resource
  • An API Resource Collection
  • A Test

Authors:

This package was created in loving memory of my father, Dr. George Anthony Pecoraro.

Releases

No releases published

Packages

No packages published

Languages