Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

NafisHoss04's avatar

Laravel Nova: $this->resource is not returning the model

For me, $this->resource returns:

App\Models\{Model} {#1716
  #connection: null
  #table: null
  #primaryKey: "id"
  #keyType: "int"
  +incrementing: true
  #with: []
  #withCount: []
  #perPage: 15
  +exists: false
  +wasRecentlyCreated: false
  #attributes: []
  #original: []
  #changes: []
  #casts: []
  #classCastCache: []
  #dates: array:1 [
    0 => "deleted_at"
  ]
  #dateFormat: null
  #appends: []
  #dispatchesEvents: []
  #observables: []
  #relations: []
  #touches: []
  +timestamps: true
  #hidden: []
  #visible: []
  #fillable: []
  #guarded: array:1 [
    0 => "*"
  ]
  #forceDeleting: false
}

So, I'm unable to use $this->resource->deleted_at or some other property.

Any suggestion on how to fix this?

0 likes
0 replies

Please or to participate in this conversation.