1. Go to this page and download the library: Download erwang/korm 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/ */
php
//create tags
$tag1=new Tag();
$tag1->text='french';
$tag1->store();
$tag2=new Tag();
$tag2->text='Roman';
$tag2->store();
$lesMiserables->tag=[$tag1,$tag2];
$lesMiserables->store();
//find book from many
$booksWithFrenchTag = $tag1->book;
php
//get the number of books
Book::count();
//get the number of books from an author
Book::count(['author_id'=>$author->id]);
php
//get data from an array
$post=['firstname'=>'Marcel','lastname'=>'Proust'];
//create a new author
$author=new Author();
$author->populate($post);
$author->store();