Skip to content

This file provides various commands to automate repetitive tasks, from setting up the environment to managing Laravel-specific functionalities like creating models, controllers, components, and more.

Notifications You must be signed in to change notification settings

ugurdanis/makefile-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Advanced Laravel Configuration with Makefile

This repository contains a Makefile designed to streamline the development workflow for Laravel projects. This file provides various commands to automate repetitive tasks, from setting up the environment to managing Laravel-specific functionalities like creating models, controllers, components, and more.

Table of Contents

Getting Started

Ensure that your environment has the following dependencies installed:

  • PHP
  • Composer
  • Node.js and npm

To use the Makefile, you must have make installed. On Unix-based systems, make is usually pre-installed. For Windows, you may need to install a compatible version of make.

Commands Overview

Setup Commands

These commands help set up your Laravel project by installing dependencies and configuring initial settings.

  • make install - Install dependencies (Composer and npm) and set up the database.
  • make serve - Start the development server.
  • make migrate - Run database migrations.
  • make seed - Run the database seeder.
  • make fresh - Refresh all migrations and seed the database.
  • make dev - Run npm in development mode.
  • make build - Run npm in production mode.

Development Commands

These commands are used to clear caches, optimize configurations, and run tests.

  • make clear - Clear all application caches (config, route, view).
  • make optimize - Cache and optimize configuration and routes.
  • make test - Run PHPUnit tests.
  • make clean - Clean temporary files and caches. This command removes the vendor, node_modules, and various cache files to ensure a fresh start for the application.
  • make fresh - Reset all migrations and seed the database. This command drops all tables and re-runs all migrations, followed by seeding the database with initial data.

Laravel Artisan Commands

The Makefile includes shortcuts for creating Laravel files, such as models, controllers, components, services, etc. Each command follows a similar format, allowing for a consistent and efficient workflow.

Model and Related Files

  • make model n=<ModelName> o=<options> - Create a model with optional migration, seeder, and factory files.

Controller and Component Creation

  • make controller n=<ControllerName> o=<options> - Create a controller with optional API or resource configuration.
  • make component n=<ComponentName> - Create a Blade component.

Additional Laravel Files

  • make migration n=<MigrationName> o=<options> - Create a migration file.
  • make seeder n=<SeederName> - Create a seeder file.
  • make request n=<RequestName> - Create a request file.
  • make event n=<EventName> - Create an event file.
  • make listener n=<ListenerName> - Create a listener file.
  • make job n=<JobName> - Create a job file.
  • make mail n=<MailName> - Create a mailable file.
  • make notification n=<NotificationName> - Create a notification file.
  • make policy n=<PolicyName> - Create a policy file.
  • make middleware n=<MiddlewareName> - Create a middleware file.
  • make factory n=<FactoryName> - Create a factory file.
  • make rule n=<RuleName> - Create a custom validation rule.
  • make resource n=<ResourceName> o=<options> - Create a resource file with optional collection.

Custom Files for Services and Helpers

  • make service n=<ServiceName> - Create a service class in the Services directory.
  • make helper n=<HelperName> - Create a helper class in the Helpers directory.

Additional Commands

  • make class n=<ClassName> - Create a generic class.
  • make view n=<ViewName> - Create a view file.
  • make interface n=<InterfaceName> - Create an interface file.

Using the Makefile

To run a command, use the following format in your terminal:

make <command> n=<Name> o=<options>

About

This file provides various commands to automate repetitive tasks, from setting up the environment to managing Laravel-specific functionalities like creating models, controllers, components, and more.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published