Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please, data is not showing up using my model #3199

Closed
wisnubaldas opened this issue Nov 22, 2024 · 2 comments
Closed

Please, data is not showing up using my model #3199

wisnubaldas opened this issue Nov 22, 2024 · 2 comments
Labels

Comments

@wisnubaldas
Copy link

wisnubaldas commented Nov 22, 2024

Summary of problem or feature request

When using a non-standard model the data does not appear

Code snippet of problem

Model GateImportIn.php

namespace App\Models\TpsOnline;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\TpsOnline\AutoPenegahan;
use Illuminate\Database\Eloquent\Relations\HasOne;

class GateImportIn extends Model
{
    use HasFactory;
    protected $connection = 'tpsonline_mau';
    protected $table = 'get_imp_in';
    protected $primaryKey = 'id_kms';
    const CREATED_AT = 'date_create';
    const UPDATED_AT = 'date_update';
    protected $fillable = array("id_kms", "kd_dok", "kd_tps", "nm_angkut", "no_voy_flight", "call_sign", "tg_tiba", "kd_gudang", "ref_num", "no_bl_awb", "tgl_bl_awb", "no_master_bl_awb", "tgl_master_bl_awb", "id_consignee", "consignee", "consignee_alm", "bruto", "uraian_brg", "no_bc11", "tgl_bc11", "no_pos_bc11", "cont_asal", "seri_kem", "kd_kem", "jml_kem", "kd_timbun", "kd_dok_inout", "no_dok_inout", "tgl_dok_inout", "wk_inout", "kd_sar_angkut", "no_pol", "pel_muat", "pel_transit", "pel_bongkar", "gudang_tujuan", "kode_kantor", "no_daftar_pabean", "tgl_daftar_pabean", "no_segel_bc", "tg_segel_bc", "no_ijin_tps", "tgl_ijin_tps", "id_kms_in", "flag_transfer", "date_create", "date_update", "respon", "token");
    // protected $cacheFor = 180;
    public function tegah(): HasOne
    {
        return $this->hasOne(AutoPenegahan::class,'no_bl_awb', 'no_bl_awb');
    }
}

Route web.php

use Illuminate\Support\Facades\Route;
use App\Models\TpsOnline\GateImportIn;
Route::get('/', function () {
    $table = GateImportIn::query();
    return Yajra\DataTables\DataTables::of($table)->make(true);
});

screenshot error

image

System details

  • Operating System Windows 11 with Laragon
  • PHP Version PHP 8.3.8 (cli) (built: Jun 4 2024 18:52:30) (ZTS Visual C++ 2019 x64)
  • Laravel Version Laravel Framework 11.33.2
  • Laravel-Datatables Version yajra/laravel-datatables": "^11.0
Copy link

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Dec 23, 2024
Copy link

This issue was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant