Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel (1/1)应用程序的FatalErrorException访问级别\CuentasBancarias::$incrementing必须是公共的(如类中的Illumb\Database\Eloquent\Model)_Laravel_Model_Eloquent - Fatal编程技术网

Laravel (1/1)应用程序的FatalErrorException访问级别\CuentasBancarias::$incrementing必须是公共的(如类中的Illumb\Database\Eloquent\Model)

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

我将此模型连接到SQLSERVER数据库,使用一个插件,允许我从数据库生成模型。但我在尝试访问视图时遇到此错误

<?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必须是公共的

所以change
protected$incrementing=false
to
public$incrementing=false


阅读错误消息的能力越强,解决此类问题的能力就越强。

仔细阅读错误消息

(1/1)应用程序的FatalErrorException访问级别\CuentasBancarias::$incrementing必须是公共的(如类中的Illumb\Database\Eloquent\Model)

如果我们把它分解,你的问题是

对应用程序的访问级别\CuentasBancarias::$incrementing必须是公共的

所以change
protected$incrementing=false
to
public$incrementing=false


阅读错误消息的能力越强,解决此类问题的能力就越强。

慢慢读标题,看看代码慢慢读标题,看看代码