Update/Insert

Insert

In order to insert a record, simply use the insert() method.

namespace Application\Models;
‚Äč
use MightyCore\Database\Model;
class UsersModel extends Model
{
public function insert($name, $age){
return $this->insert([
"name" => $name,
"age" => $age
])
}
}

The insert() method takes in an array parameter which would map its key to value pair based on the table columns.