PHP code example of hqq / scenario

1. Go to this page and download the library: Download hqq/scenario 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/ */

    

hqq / scenario example snippets


'providers' => [

    Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
    Illuminate\Auth\AuthServiceProvider::class,
    ...
    hqq\scenario\ScenarioServiceProvider::class,

],

 namespace App;

use Illuminate\Database\Eloquent\Model;

class Units extends Model {
	static $rules = [
		'phone'       => [')\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/'],
		'email'       => ['ected $table = "units";
	protected $fillable = ['picture', 'phone', 'address', 'services', 'website', 'email', 'description', 'about_us'];
}

Scenarioo::setRules(Units::$rules);
Scenarioo::setScenario(['store','mostafa']);
$validation = \Validator::make($request->all(),Scenarioo::Rules());
if($validation->fails()){
	return \Redirect::back()->withErrors($validation->errors())->withInput();
}