PHP code example of hashemi / fireworks

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

    

hashemi / fireworks example snippets


composer 

class User extends Model
{
    // Use Fireworks Trait
    // ....
    use \Hashemi\Fireworks\Fireworks;
    // ....
}

class User extends Model
{
    // Use Fireworks Trait
    // ....
    use \Hashemi\Fireworks\Fireworks;
    protected $fillable = [
        'name',
    ];
    // ....
    protected function onModelCreating($model) {
        $model->name = "Kuddus";
    }

    protected function onModelUpdating($model) {}

    protected function onModelSaving($model) {}
    
    protected function onModelCreated($model) {}

    protected function onModelUpdated($model) {}

    protected function onModelSaved($model) {
        $model->name = "Ali";
        $model->save();
    }
    
    protected function onModelNameSaved($model, $newValue, $oldValue)
    {
        
    }
}