PHP code example of talium / wiz

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

    

talium / wiz example snippets




namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Lerouse\LaravelRepository\HasRepository;
use TaliumAbstract\Attributes\Table;
use TaliumAbstract\Trait\InjectModel;

#[Table("nama tabel")]
class ... extends Model
{
    use HasFactory;
    /**
     * untuk menyusun fillable dan table pada atribute dan rules
     */
    use InjectModel;
    
    /**
     * jika menggunakan __construct tambahkan 
     *  $this->Iject(); agar attribute dapat di exekusi
     */
    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);
        $this->Iject();
    }

    /**
     * harus dengan nama rules 
     */
    public static function rules()
    {
        return [
            "name" => "

    http://domain/api
 
    /**
     * request basis all
    */
    #[Get("/show")]
    #[Get("/")]
   
    /**
     * request basis paginate
    */
    #[Get("/paginate")]
    
    /**
     * request basis firstId
    */
    #[Get("/find/{id}")]
   

    /**
     * request store
    */
    #[Post("/store")]
    #[Post("/")]
   

    /**
     * request update
    */
    #[Post("/update/{id}")]
    #[Post("/store/{id}")]
    #[Put("/")]
   

    /**
     * request delete
    */
    #[Get("/destory/{id}")]
    #[Get("/delete/{id}")]
 php
#[Model(MastersStatus::class)]
class MastersStatusController extends Controller
{
     use AutoCrudApi;
     public function __construct(Request $request)
     {
        $request->merge([
            'status_anggota' => 'aktif',
            'bawaslu_id' => 1,
            'user_id' => 1,
        ]);
        $this->Initialize();
    }
}