PHP code example of sectheater / artify

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

    

sectheater / artify example snippets



php artisan artify:install

bash
  // ? means optional.
 // php artisan artify:observer <name of Observer> <-m
bash
	php artisan artify:response <name>
	// Example , please try to follow the convention of naming.. <model><method>Response
    php artisan artify:response PostShowResponse
bash

// Role Model

protected $casts = ["permissions" => "array"];


  php artisan artify:register-authorization

  Route::get("/post/create","PostController@create")->middleware("can:create-post");
bash

php artisan artify:facade <name>

bash
 php artisan artify:crud <model-name> (-r?)
 // -r is optional , it will generate you the repository.
bash
php artisan adr:install
bash
 php artisan adr:generate Addresses IndexAddress -sra
bash
php artisan adr:generate Addresses -m
bash
 php artisan adr:generate Videos IndexVideo -A
bash
    dd($user->hasAnyRole(["create-post","foo-bar","approve-post"])); // returns true/false;
  
bash 
   dd($user->hasAllRole(["foo-bar","upgrade-user"])); // returns true/false;