1. Go to this page and download the library: Download accolon/izanagi 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/ */
accolon / izanagi example snippets
namespace App\Models;
use Accolon\Izanagi\Attributes\Field;
use Accolon\Izanagi\Attributes\Table;
use Accolon\Izanagi\Types\FieldType;
use Accolon\Izanagi\Entity;
#[Table(name: "users")]
class User extends Entity
{
#[Field(type: FieldType::Integer, primary: true, length: 11, autoIncrement: true)]
public int $id;
#[Field(type: FieldType::String, length: 30)]
public string $name;
#[Field(type: FieldType::String, length: 30)]
public string $password;
#[Field(type: FieldType::Boolean)]
public bool $admin;
}
namespace App\Repositories;
use Accolon\Izanagi\Repository;
use App\Models\User;
class UserRepository extends Repository
{
protected string $class = User::class;
}