PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, February 20, 2022

[FIXED] Laravel Fetch Value form Session

 February 20, 2022     laravel, laravel-5     No comments   

Issue

Here is my Session and i would like to fetch the value from Sample_table to get the original array value how can i do that ?

{{ dd(Session::get('sample')[0]) }}

 Sample_table{#266 ▼
  #fillable: array:6 [▶]
  #table: "Sample_table"
  #primaryKey: "id"
  +timestamps: true
  #connection: "mysql"
  #keyType: "int"
  +incrementing: true
  #with: []
  #withCount: []
  #perPage: 15
  +exists: true
  +wasRecentlyCreated: false
  #attributes: array:20 [▶]
  #original: array:20 [▼
    "id" => "9"
    "firstName" => "test"
    "lastName" => "asdf"
    "middleName" => "test"
    "contactNo" => "2147483647"
    "emailAddress" => "test@gmail.com"
    "residenceAddress" => "afsf"
    "province_id" => "6"
    "city_id" => "3"
    "barangay_id" => "16982"
    "copyMailing" => null
    "mailingAddress" => null
    "mailing_province_id" => "6"
    "mailing_city_id" => "3"
    "mailing_barangay_id" => "16982"
    "status" => "0"
    "userIdentity" => "0"
    "global_id" => "0"
    "updated_at" => "0000-00-00 00:00:00"
    "created_at" => "0000-00-00 00:00:00"
  ]

Solution

You can use ->getRawOriginal():

Session::get('sample')[0]->getRawOriginal();


Answered By - Martin Osusky
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing