Foreman is a Laravel scaffolding application that automates common tasks you typically perform with each new Laravel app you create

Related tags

Laravel foreman
Overview

Foreman

Foreman is a Laravel scaffolding application that automates common tasks you typically perform with each new Laravel app you create. The directives you want Forman to perform are outlined in a JSON based template file.

Build Status Code Coverage Scrutinizer Code Quality

README Contents

## What does it do?
  • Structure
    • Copy files and directories
    • Move files and directories
    • Delete files and directores
    • Touch files
    • Make new directories
  • Composer
    • Require composer package dependencies
    • Require development composer package dependencies
    • Manage the composer autoload > classmap
    • Manage the composer autoload > psr-0 settings
    • Manage the composer autoload > psr-4 settings
## Installation ### Download the PHAR The simplest method of installation is to simply [download the foreman.phar](https://github.com/indatus/foreman/raw/master/foreman.phar) file from this repository. > **(Optional) Move and set permissions** Now if you'd like you can move the PHAR to `/usr/local/bin` as `foreman` for easy access. You may need to grant the file execution privileges (`chmod +x`) before running commands. ### Compile from source To compile the foreman.phar file yourself, clone this repository and run the `box build` command. To run box commands, you must install [kherge/Box](https://github.com/kherge/Box).

See optional move and permissions above.

### Install with Homebrew

You can also install Foreman via Homebrew. If you don't already have homebrew installed, you can install it with:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Next you'll need to add the sources necessary to install foreman:

brew tap homebrew/dupes
brew tap homebrew/versions
brew tap josegonzalez/homebrew-php

Now update all formulae

brew update

And then install Foreman

brew install foreman
### Updating Foreman

To update Foreman, you may use the foreman self-update command.

## Scaffolding a Template

To get started you'll want to generate a default / blank Foreman template. You can do this with the command:

foreman scaffold /path/to/my/template.json

Note: If you provide a directory instead of a file, Foreman will create a foreman-tpl.json file in the given directory.

A default Foreman template looks like this:

{
    "structure": {
        "copy": [
            {
                "from": "",
                "to": ""
            }
        ],
        "move": [
            {
                "from": "",
                "to": ""
            }
        ],
        "delete": [

        ],
        "touch": [

        ],
        "mkdir": [

        ]
    },
    "composer": {
        "require": [
            {
                "package": "laravel/framework",
                "version": "4.1.*"
            }
        ],
        "require-dev": [
            {
                "package": "",
                "version": ""
            }
        ],
        "autoload": {
            "classmap": [
                "app/commands",
                "app/controllers",
                "app/models",
                "app/database/migrations",
                "app/database/seeds",
                "app/test/TestCase.php"
            ],
            "psr-0": [

            ],
            "psr-4": [

            ]
        }
    }
}
### Working with a template

For structure references you can use either an absolute path (to a file or directory) or a path relative to your new application's root.

## Build a Laravel app from a template

In order to use your Foreman template to generate a new Laravel application you just need to use the build command.

The first argument is the absolute path to where you want to install the application, the second argument is the location of the template file.

foreman build /install/app/here /path/to/template.json

Now Foreman will generate your Laravel app with all your configuration applied.

Comments
  • Error windows run

    Error windows run

    trying to run this command on windows machine:

    php foreman.phar "C:\wamp\www\_homestead\newproject" template.json
    

    got this error: [InvalidArgumentException] There are no commands defined in the "C" namespace.

    My template file:

    {
        "structure": {
            "copy": [
                {
                    "from": "",
                    "to": ""
                }
            ],
            "move": [
                {
                    "from": "",
                    "to": ""
                }
            ],
            "delete": [
    
            ],
            "touch": [
    
            ],
            "mkdir": [
    
            ]
        },
        "composer": {
            "require": [
                {
                    "package": "laravel/framework",
                    "version": "4.2.*"
                }
            ],
            "require-dev": [
                {
                    "package": "way/generators",
                    "version": "~2.0"
                }
            ],
            "require-dev": [
                {
                    "package": "zizaco/confide",
                    "version": "~4.0@dev"
                }
            ],
            "require-dev": [
                {
                    "package": "zizaco/entrust",
                    "version": "1.2.*@dev"
                }
            ],
            "require-dev": [
                {
                    "package": "intervention/image",
                    "version": "2.*"
                }
            ],
            "require-dev": [
                {
                    "package": "barryvdh/laravel-debugbar",
                    "version": "1.*"
                }
            ],
            "require-dev": [
                {
                    "package": "barryvdh/laravel-ide-helper",
                    "version": "1.*"
                }
            ],
            "autoload": {
                "classmap": [
                    "app/commands",
                    "app/controllers",
                    "app/models",
                    "app/database/migrations",
                    "app/database/seeds",
                    "app/test/TestCase.php"
                ],
                "psr-0": [
    
                ],
                "psr-4": [
    
                ]
            }
        }
    }
    
    opened by marty12321 1
  • Brew installation

    Brew installation

    Foreman is now available as a Hombrebrew package: https://github.com/josegonzalez/homebrew-php/pull/1021

    # Add sources
    brew tap homebrew/dupes
    brew tap homebrew/versions
    brew tap josegonzalez/homebrew-php
    
    # Update all formulae
    brew update
    
    # Install Foreman
    brew install foreman
    

    Feel free to update your install instructions

    Happy coding,

    Lucas

    opened by lucasmichot 1
  • change order of copy, move, delete and repeat

    change order of copy, move, delete and repeat

    It would be good if the order of the structure could be changed and repeated i.e. pseudo example

    delete > bootstrap/start.php copy > template/bootstrap/start.php bootstrap/start.php ...other structure mkdir > copy > something else as it's in the new directory

    opened by daveganley 0
  • Error: composer.json file does not exist

    Error: composer.json file does not exist

    When following the setup instructions in the readme I get the following error when running:

    foreman build /path/to/dir template.json

    [Foreman]: Installing fresh Laravel app [Foreman]: Done, Laravel installed at: /home/chris/Dropbox/Projects/Playground/foreman/ [Foreman]: Reading template from template.json [Copy]: from /home/chris/Dropbox/Projects/Playground/foreman/ to /home/chris/Dropbox/Projects/Playground/foreman/ [Foreman]: Reading composer.json from /home/chris/Dropbox/Projects/Playground/foreman/composer.json

    Error: [Illuminate\Filesystem\FileNotFoundException]
    File does not exist at path /home/chris/Dropbox/Projects/Playground/foreman
    /composer.json

    Do I need to also have an existing composer.json file when creating this? I thought the template.json file was the only thing needed to scaffold a new app as per the README.

    opened by devcflynn 3
  • Requiring an absolute path is inconvenient

    Requiring an absolute path is inconvenient

    I vote that requiring an absolute path is inconvenient. I'd like to at least add functionality to substitute ~ or ./ in paths which would translate into an absolute path.

    (I've created a fork - How do I test changes on my local machine?)

    opened by mtthlm 4
Owner
Indatus
Indatus
Perform Self-Diagnosis Tests On Your Laravel Application

Perform Self-Diagnosis Tests On Your Laravel Application This package allows you to run self-diagnosis tests on your Laravel application. It comes wit

Beyond Code 1.4k Dec 13, 2022
A package for Laravel to perform basic git commands on locally integrated packages.

A package for Laravel to perform basic git commands on locally integrated development packages. If working within multiple local development packages or repositories at once this package is meant to ease the burden of navigating to each individual repository to perform basic git commands.

null 3 Jul 26, 2022
Perform Bulk/Batch Update/Insert/Delete with laravel.

Bulk Query Perform Bulk/Batch Update/Insert/Delete with laravel. Problem I tried to make bulk update with laravel but i found that Laravel doesn't sup

Mohamed Samir 9 Dec 14, 2021
A university system that creates a timetable programm for subjects,classes and teachers which is used to create a programm for each semester. All this served as a website.

Timetable-System-Generator A university system that creates a timetable programm for subjects,classes and teachers which is used to create a programm

null 3 Nov 19, 2022
Laravel Jetstream is a beautifully designed application scaffolding for Laravel.

Laravel Jetstream is a beautifully designed application scaffolding for Laravel. Jetstream provides the perfect starting point for your next Laravel application and includes login, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management.

The Laravel Framework 3.5k Jan 8, 2023
This Package helps you in laravel application to log all desired activity for each request from request entry point to generate response at a single snapshot.

Laravel Scenario Logger This Package helps you in laravel application to log all desired activity for each request from request entry point to generat

Mehrdad Mahdian 6 Sep 27, 2021
Specially customized Laravel jetstream's scaffolding for Frest html + laravel admin Template

frest-html-laravel-jetstream Specially customized Laravel jetstream's scaffolding for Frest html + laravel admin Template. It'll not work with any oth

PIXINVENT CREATIVE STUDIO 0 Apr 5, 2022
Laravel UI, Auth, & CRUD scaffolding package using Bootstrap & Livewire.

bastinald/ux Laravel UI, Auth, & CRUD scaffolding package using Bootstrap & Livewire. Features Automatic migrations Automatic routing Automatic passwo

null 33 Nov 26, 2022
A Laravel starter kit with auth scaffolding using Livewire & Bootstrap.

Zephyr This package is a Laravel starter kit with auth scaffolding using Livewire & Bootstrap. It was created for people who prefer using Livewire & B

null 23 Aug 26, 2022
Tailwind scaffolding for the Laravel framework.

Introduction Laravel Jetstream is a beautifully designed application scaffolding for Laravel. Jetstream provides the perfect starting point for your n

Devanox Private Limited 0 Jul 20, 2022
This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified.

Laravel Verify New Email Laravel supports verifying email addresses out of the box. This package adds support for verifying new email addresses. When

Protone Media 300 Dec 30, 2022
A laravel Livewire Dynamic Selects with multiple selects depending on each other values, with infinite levels and totally configurable.

Livewire Combobox: A dynamic selects for Laravel Livewire A Laravel Livewire multiple selects depending on each other values, with infinite levels of

Damián Aguilar 25 Oct 30, 2022
Update multiple Laravel Model records, each with it's own set of values, sending a single query to your database!

Laravel Mass Update Update multiple Laravel Model records, each with its own set of values, sending a single query to your database! Installation You

Jorge González 88 Dec 31, 2022
A Laravel 8 and Livewire 2 demo showing how to search and filter by tags, showing article and video counts for each tag (Polymorphic relationship)

Advanced search and filter with Laravel and Livewire A demo app using Laravel 8 and Livewire 2 showing how to implement a list of articles and tags, v

Sérgio Jardim 19 Aug 29, 2022
Shows the path of each blade file loaded in a template

Laravel Tracer Tracer shows the paths of all the Blade files that are loaded into your templates. This could be very convenient for a number of reason

Appstract 97 Oct 1, 2022
Plugin for Filament Admin that adds a dropdown menu to the header to quickly create new items.

Filament Quick Create Plugin for Filament Admin that adds a dropdown menu to the header to quickly create new items from any page. Installation Instal

Adam Weston 45 Dec 27, 2022
Laravel Common Password Validator

laravel-common-password-validator Laravel Common Password Validator An optimized and secure validator to check if a given password is too common. By d

WedgeHR 1 Nov 6, 2021
A PHP package that provides common Data and Value Objects, that are Laravel castable.

Common Casts A PHP package that provides common Data and Value Objects, that are Laravel castable. Installation composer require juststeveking/common-

Steve McDougall 2 Sep 21, 2022
Tasty TADS 3 recipes for solving common and uncommon problems.

TADS 3 Cookbook Tasty TADS 3 recipes for solving common and uncommon problems when writing interactive fiction. There are two aspects of the TADS 3 Co

Jim Nelson 9 Apr 17, 2022