Git Product home page Git Product logo

laravel-zero's Introduction

StyleCI Status Build Status Quality Score Latest Stable Version Software License

This is a community project and not an "official" Laravel one

Laravel Zero was created by Nuno Maduro and it is maintained by Nuno Maduro & Harish Toshniwal. Laravel Zero is a micro-framework that provides an elegant starting point for your next console application. Unofficial and customized version of Laravel optimized for building console/shell/command-line applications.

Installation & Usage

Requires PHP 7.1+

Simply create a new Laravel Zero project using Composer:

composer create-project --prefer-dist laravel-zero/laravel-zero your-app-name

Your Laravel Zero project will be then created in the your-app-name folder. Laravel Zero provides a default command placed in the app/DefaultCommand.php file which will be executed by default. To execute it, run the following command in your app's directory:

php your-app-name

You can rename your app anytime by running the following command in your app directory:

php your-app-name app:rename newName

You may review the documentation of the Artisan Console component on Laravel's Official Website.

Components

Laravel Zero ships with a Database component out of the box to push your console app to the next level. As you might have already guessed it is Laravel's Illuminate Database component that works with the same breeze in Laravel Zero environment too.

To install the components run the following command in your Laravel Zero app directory:

php your-app-name component:install

This will allow you to select the component to install from the list of available components. Right now, only the Database component is available but many more are in the pipeline.

Configuration

The configuration of your console application goes in config\config.php. In this file, you should define your application's list of commands and your Laravel Service Providers in this file.

        /*
         * Here goes the application name.
         */
        'name' => 'Laravel Zero',

        /*
         * Here goes the application version.
         */
        'version' => '1.0.0',

        /*
         * If true, development commands won't be available as the app
         * will be in the production environment.
         */
        'production' => false,

        /*
         * Here goes the application default command.
         *
         * You may want to remove this line in order to ask the user what command he
         * wants to execute.
         */
        'default-command' => App\DefaultCommand::class,

        /*
         * Here goes the application list of commands.
         *
         * Besides the default command the user can also call
         * any of the commands specified below.
         */
        'commands' => [
            // App\Commands\YourNewCommand::class,
        ],

        /*
         * Here goes the application list of Laravel Service Providers.
         * Enjoy all the power of Laravel on your console.
         */
        'providers' => [
            App\Providers\AppServiceProvider::class,
            \NunoMaduro\LaravelDesktopNotifier\LaravelDesktopNotifierServiceProvider::class,
        ],

Building a standalone application

Your Laravel Zero project, by default, allows you to build a standalone PHAR archive to ease the deployment or the distribution of your project.

php your-app-name app:build <your-build-name>

The build will provide a single phar archive, ready to use, containing all the code of your project and its dependencies.

Note that the generated file will still need a PHP installation respecting your project's requirements (PHP version, extensions, etc.) on the users' computers to be used. You will then be able to execute it directly:

./builds/<your-build-name>

or on Windows:

C:\application\path> php builds\<your-build-name>

Contributing

  • Thank you for considering to contribute to Laravel Zero. All the contribution guidelines are mentioned here.

Stay In Touch

You can have a look at the CHANGELOG & Releases for constant updates & detailed information about the changes. You can also follow the twitter account for latest announcements or just come say hi!: @laravelzero

Credits

License

Laravel Zero is an open-sourced software licensed under the MIT license.

laravel-zero's People

Contributors

ilesinge avatar introwit avatar nunomaduro avatar scrutinizer-auto-fixer avatar stefanzweifel avatar vojtasvoboda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.