PHP code example of angle / architect

1. Go to this page and download the library: Download angle/architect library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

angle / architect example snippets




use Angle\Architect\Sprint;
use Angle\Architect\Code\Blueprint;
use Angle\Architect\Facades\Architect;

class CreateNewUserSprint extends Sprint
{
    /**
     * Runs the sprint.
     *
     * @return void
     */
    public function run()
    {
        Architect::feature('Create new user', function (Blueprint $code) {
            $code->task('validate request')->expect('request')->return('is valid');
            $code->task('save user')->expect('request')->return('user');
            $code->task('send email to administrators')->expect('user');
        });
    }
}
shell
php artisan architect:install
config/architect.php

php artisan sprint

php artisan sprint --pretend

php artisan sprint --force

php artisan sprint:rollback