afghany

Experience

250

0 Best Reply Awards

  • Member Since 1 Month Ago
  • 1 Lesson Completed
  • 0 Favorites

22nd April, 2018

afghany left a reply on Got This Error "htmlspecialchars() Expects Parameter 1 To Be String, Object Given" When I Try To Json_decode In Blade File • 1 month ago

@Vilfago same error ...

Can't var_dump $before cuz there is a error "htmlspecialchars() expects parameter 1 to be string, array given"

here is the var_dump for $modify

object(App\modifyHistory)#479 (25) { ["guarded":protected]=> array(0) { } ["connection":protected]=> string(5) "mysql" ["table":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["keyType":protected]=> string(3) "int" ["incrementing"]=> bool(true) ["with":protected]=> array(0) { } ["withCount":protected]=> array(0) { } ["perPage":protected]=> int(15) ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) ["attributes":protected]=> array(8) { ["id"]=> int(8) ["user_id"]=> int(91) ["modified_id"]=> int(6) ["modified_type"]=> string(10) "App\Thread" ["before"]=> string(48) "{"slug":"one-more-try-6","title":"one more try"}" ["after"]=> string(50) "{"slug":"one-more-try2-6","title":"one more try2"}" ["created_at"]=> string(19) "2018-04-17 14:45:06" ["updated_at"]=> string(19) "2018-04-17 14:45:06" } ["original":protected]=> array(8) { ["id"]=> int(8) ["user_id"]=> int(91) ["modified_id"]=> int(6) ["modified_type"]=> string(10) "App\Thread" ["before"]=> string(48) "{"slug":"one-more-try-6","title":"one more try"}" ["after"]=> string(50) "{"slug":"one-more-try2-6","title":"one more try2"}" ["created_at"]=> string(19) "2018-04-17 14:45:06" ["updated_at"]=> string(19) "2018-04-17 14:45:06" } ["casts":protected]=> array(0) { } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["appends":protected]=> array(0) { } ["events":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["relations":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["timestamps"]=> bool(true) ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["fillable":protected]=> array(0) { } }

20th April, 2018

afghany left a reply on Got This Error "htmlspecialchars() Expects Parameter 1 To Be String, Object Given" When I Try To Json_decode In Blade File • 1 month ago

The problem with json_decode function Without using it there is no errors but it's string not array

afghany left a reply on Got This Error "htmlspecialchars() Expects Parameter 1 To Be String, Object Given" When I Try To Json_decode In Blade File • 1 month ago

@Snapey before attribute saved as string can't fetch the title until i decode it , And when i use json_decode i got this error

afghany left a reply on Got This Error "htmlspecialchars() Expects Parameter 1 To Be String, Object Given" When I Try To Json_decode In Blade File • 1 month ago

@Vilfago I fetch my 8 attrributes my before and after attribute saved as string i need to decode them and when i decode i got this error

18th April, 2018

afghany left a reply on Got This Error "htmlspecialchars() Expects Parameter 1 To Be String, Object Given" When I Try To Json_decode In Blade File • 1 month ago

@jcmargentina Modify is a object contains my attributes Two of them "before " , "after" in this format I am tring to json_decode them

"before" => "{"slug":"one-more-try-6","title":"one more try"}" "after" => "{"slug":"one-more-try2-6","title":"one more try2"}"

afghany left a reply on Got This Error "htmlspecialchars() Expects Parameter 1 To Be String, Object Given" When I Try To Json_decode In Blade File • 1 month ago

@jcmargentina i did before and got this error Undefined property: stdClass::$before

17th April, 2018

afghany started a new conversation Got This Error "htmlspecialchars() Expects Parameter 1 To Be String, Object Given" When I Try To Json_decode In Blade File • 1 month ago

here is my response

Collection {#478 ▼ #items: array:5 [▼ 0 => modifyHistory {#479 ▼ #guarded: [] #connection: "mysql" #table: null #primaryKey: "id" #keyType: "int" +incrementing: true #with: [] #withCount: [] #perPage: 15 +exists: true +wasRecentlyCreated: false #attributes: array:8 [▼ "id" => 8 "user_id" => 91 "modified_id" => 6 "modified_type" => "App\Thread" "before" => "{"slug":"one-more-try-6","title":"one more try"}" "after" => "{"slug":"one-more-try2-6","title":"one more try2"}" "created_at" => "2018-04-17 14:45:06" "updated_at" => "2018-04-17 14:45:06" ] #original: array:8 [▶] #casts: [] #dates: [] #dateFormat: null #appends: [] #events: [] #observables: [] #relations: [] #touches: [] +timestamps: true #hidden: [] #visible: [] #fillable: [] } 1 => modifyHistory {#480 ▶} 2 => modifyHistory {#481 ▶} 3 => modifyHistory {#482 ▶} 4 => modifyHistory {#483 ▶} ] }

and here is my blade code

@forelse($history as $key => $modify)

                            <li class="list-group-item">

                                <div class="level">

                                    <tr>

                                        <td> {{json_decode($modify->before)}} </td>


                                    </tr>


                                </div>

                            </li>

                        @empty

                            <strong>There is no updates for this thread </strong>

                        @endforelse
Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.