Laravel (1/1)应用程序的FatalErrorException访问级别\CuentasBancarias::$incrementing必须是公共的(如类中的Illumb\Database\Eloquent\Model)
我将此模型连接到SQLSERVER数据库,使用一个插件,允许我从数据库生成模型。但我在尝试访问视图时遇到此错误Laravel (1/1)应用程序的FatalErrorException访问级别\CuentasBancarias::$incrementing必须是公共的(如类中的Illumb\Database\Eloquent\Model),laravel,model,eloquent,Laravel,Model,Eloquent,我将此模型连接到SQLSERVER数据库,使用一个插件,允许我从数据库生成模型。但我在尝试访问视图时遇到此错误 <?php namespace App; use Illuminate\Database\Eloquent\Model; class CuentasBancarias extends Model { protected $table = 'CUENTASBANCARIAS_GRUPO7F'; protected $primaryKey = 'idcuentasban
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class CuentasBancarias extends Model
{
protected $table = 'CUENTASBANCARIAS_GRUPO7F';
protected $primaryKey = 'idcuentasbancarias';
protected $incrementing = false;
protected $fillable = ['idcuentasporcobrar', 'idcuentaporpagar', 'nombre_banco', 'nro_cuenta', 'titular_cuenta', 'fecha', 'total_deposito', 'total_retiro', 'Id_CLIENTES', 'Id_COMPRAS', 'Id_PROVEEDORES', 'id_VENTAS', 'Estado'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function cuentasporcobrarGRUPO7F()
{
return $this->belongsTo('App\CuentasporcobrarGRUPO7F', 'idcuentasporcobrar', 'idcuentasporcobrar');
}
public function cuentasporpagarGRUPO7F()
{
return $this->belongsTo('App\CuentasporpagarGRUPO7F', 'idcuentaporpagar', 'idcuentaporpagar');
}
public function sUBCUENTASGRUPO9s()
{
return $this->hasMany('App\SUBCUENTASGRUPO9', 'idcuentasbancarias', 'idcuentasbancarias');
}
仔细阅读错误消息
(1/1)应用程序的FatalErrorException访问级别\CuentasBancarias::$incrementing必须是公共的(如类中的Illumb\Database\Eloquent\Model)
如果我们把它分解,你的问题是
对应用程序的访问级别\CuentasBancarias::$incrementing必须是公共的
所以changeprotected$incrementing=false
topublic$incrementing=false代码>
阅读错误消息的能力越强,解决此类问题的能力就越强。仔细阅读错误消息
(1/1)应用程序的FatalErrorException访问级别\CuentasBancarias::$incrementing必须是公共的(如类中的Illumb\Database\Eloquent\Model)
如果我们把它分解,你的问题是
对应用程序的访问级别\CuentasBancarias::$incrementing必须是公共的
所以changeprotected$incrementing=false
topublic$incrementing=false代码>
阅读错误消息的能力越强,解决此类问题的能力就越强。慢慢读标题,看看代码慢慢读标题,看看代码