I'm returning a value from one variable in my controller, but this is different results when I get my blade ($ Roles) day by day
Public function index () {$ users = $ this- & gt; User- & gt; GetAll (); // DBUserRepository $ roles = $ this- & gt; User- & gt; GetRoles ($ users) return $ roles; }
yields correct results
{ID: "1", username: "Muzikman", email: "matt.paolini@gmail.com" password: "$ 2y $ 10 $ Sp7k9Fs0DwFSYHTpWrTWquFmXJpkiKfRIHsjYtdEXTvbdOJwv9AtG", password_confirmation: "", CONFIRMATION_CODE: "91f0583ed76c95ebf378648d65d0eac7", remember_token: "bGmdTchXtilBj41FIazkFS3PDZzr1tVKmTFnMkeeSoD7wpW6hoQ07A42plle", confirmed: "1", created_at: "2014-10-19 00:17: 55 ", updated_at:" 2014-10-20 15:07:01 ", roles: [{id:" 12 ", name:" member ", created_a" 2014-10-24 20:45:26 ", update Done_a: "2014-10 -24 20:45:26",}]
However, when controlling the role of $ for the blade, it will give different results It is
Public function index () {$ user = $ this- & gt; User- & gt; Get (all); $ Roles = $ this- & gt; User- & gt; Miller ($ user); See refresh: see ('admin.index', compact ('user')) - & gt; Together ($ roles); }
Blade gives var dump {{dd ($ roll)}}
array (size = 2) 0 = & gt; Object (user) [254] Protected 'connections' = & gt; Zero protected 'table' = & gt; Zero-protected 'primary' = & gt; String 'id' (length = 2) protected 'per page' = & gt; Int 15 public 'increase' => Boolean truth public 'timestamp' = & gt; Boolean True Protected 'Properties' = & gt; Array (size = 10) 'id' = & gt; String '1' (length = 1) 'username' = & gt; String 'Muzikman' (length = 8) 'email' = & gt; String 'matte Payolini @ gmail.com '(length = 22)' password '= & gt; String '$ 2y $ 10 $ sp7k9Fs0DwFSYHTpWrTWquFmXJpkiKfRIHsjYtdEXTvbdOJwv9AtG' 'password_confirmation' = & gt; String '' (length = 0) 'confirmation_code' = & gt; String '91f0583ed76c95ebf378648d65d0eac7' (length = 32) 'remember_token' = & gt; String 'bGmdTchXtilBj41FIazkFS3PDZzr1tVKmTFnMkeeSoD7wpW6hoQ07A42plle' ('confirmed' => string '1' (length = 1) 'created_at' = & gt; string '2014-10-19 00:17:55' (length = 19) 'updated_at '= & Gt; String' 2014-10-20 15:07:01 '(length = 19) protected' original '=> array (size = 10)' id '=> string' 1 '( Length = 1) 'username' = & gt; string 'Muzikman' (length = 8) 'email' = & gt; string 'matt.paolini@gmail.com' (length = 22) 'password' => String '$ 2y $ 10 $ Sp7k9Fs0DwFSYHTpWrTWquFmXJpkiKfRIHsjYtdEXTvbdOJwv9AtG' 'password_confirmation' = & gt; string '' (length = 0) 'confirmation_code' = & gt; = '1' (length = 1) 'created_it' = & gt; string '91f0583ed76c95ebf378648d65d0eac7' (length = 32) 'memory_token' => string 'bGmdTchXtilBj41FIazkFS3PDZzr1tVKmTFnMkeeSoD7wpW6hQm7A42plle' (length = 60) 'confirmation' => 2014-10-19 12:17:55 '(length = 19)' updated_at '=> string' 2014-10-20 15:07:01 '(length = 19) Secure' reliance on '=' Array (size = 1)
Can anyone tell what is happening here?
Public function is sending the blade from the controller with the different array contents to the same data object for the getRoles ($ user) {foreach ($ users)). $ User $ user (as the user) with {$ roles} = \ user :: ('roles') - & gt; Find ($ user-> ID); } Return $ Roles; }
DD ($ roles)
Look in the form, as it is in the second set of output.
{{$ roles}} object to your
toJson ()
function, which results in your first output output.
Comments
Post a Comment