Closed ghost closed 8 years ago
Determine if primary key is the standard id or not.
id
If not, create primary key property and remove the primary key field from the $fillable array.
$fillable
Example:
CREATE TABLE `order_product` ( `order_product_id` int(11) NOT NULL AUTO_INCREMENT, `order_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `model` varchar(64) NOT NULL, `quantity` int(4) NOT NULL, `price` decimal(15,4) NOT NULL DEFAULT '0.0000', `total` decimal(15,4) NOT NULL DEFAULT '0.0000', `tax` decimal(15,4) NOT NULL DEFAULT '0.0000', `reward` int(8) NOT NULL, PRIMARY KEY (`order_product_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Would produce:
protected $primaryKey = 'order_product_id'; protected $fillable = [ 'order_id', 'product_id', 'name', 'model', 'quantity', 'price', 'total', 'tax', 'reward' ];
Unfortunately I don't have much time until next month, therefore I'd love a pull request for this:)
ah, actually this has been fixed with #16
Determine if primary key is the standard
id
or not.If not, create primary key property and remove the primary key field from the
$fillable
array.Example:
Would produce: