tareq1988 / wp-eloquent

Eloquent ORM for WordPress
https://tareq.co/2015/05/eloquent-orm-in-wordpress/
566 stars 135 forks source link

problem with save new model in database #20

Open hamedmoody opened 8 years ago

hamedmoody commented 8 years ago

hi i create a model in wordpress but not save in database:

<?php
class Etekaf extends \WeDevs\ORM\Eloquent\Model {

}
$et = new Etekaf();
$et->name = 'my Name';
$et->save();

and static 'create' method error:

Fatal error: Uncaught exception 'Illuminate\Database\Eloquent\MassAssignmentException' with message 'email' in C:\xampp\htdocs\daneshjooyar\wp-content\plugins\dyedd-extra-option\vendor\illuminate\database\Eloquent\Model.php:404 Stack trace: #0 C:\xampp\htdocs\daneshjooyar\wp-content\plugins\dyedd-extra-option\vendor\illuminate\database\Eloquent\Model.php(259): Illuminate\Database\Eloquent\Model->fill(Array) #1 C:\xampp\htdocs\daneshjooyar\wp-content\plugins\dyedd-extra-option\vendor\tareq1988\wp-eloquent\src\Eloquent\Model.php(19): Illuminate\Database\Eloquent\Model->__construct(Array) #2 C:\xampp\htdocs\daneshjooyar\wp-content\plugins\dyedd-extra-option\vendor\illuminate\database\Eloquent\Model.php(527): WeDevs\ORM\Eloquent\Model->__construct(Array) #3 C:\xampp\htdocs\daneshjooyar\wp-content\plugins\dyedd-extra-option\dyedd-extra-option.php(96): Illuminate\Database\Eloquent\Model::create(Array) #4 C:\xampp\htdocs\daneshjooyar\wp-settings.php(254): include_once('C:\\xampp\\htdocs...') #5 C:\xampp\htdocs\daneshjooyar\wp-co in C:\xampp\htdocs\daneshjooyar\wp-content\plugins\dyedd-extra-option\vendor\illuminate\database\Eloquent\Model.php on line 404

tareq1988 commented 8 years ago

Take a look here