michalis

michalis

Member Since 4 Years Ago

Experience Points
13,670
Total
Experience

1,330 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
156
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 3
13,670 XP
Apr
03
1 month ago
Activity icon

Replied to Having Trouble Looping Through Array In Blade (object Was Decoded From Json)

is js I was simply doing if ( $variablename) to check if existed, apparently in php, or blade at least you need to use isset, or the shorthand that @snapey posted

Activity icon

Replied to Having Trouble Looping Through Array In Blade (object Was Decoded From Json)

@beyond I get data from a form using javascript and put it in the database as a string, then when I retrieve the model in the controller I use json decode to turn the string into a php object so that i can manipulate it, but it obviously has some kinks and it gives me errors

@snapey I tried your code and it seems to work, thank you for the help!! I did use if statements to check if pizzaIngredients existed, but I guess it wasnt doing the job, can you explain the ?? [] part? is it shorthand? how can i use that for non array items like single values or objects? cause i seem to be having issues with those too

Apr
02
1 month ago
Activity icon

Started a new Conversation Having Trouble Looping Through Array In Blade (object Was Decoded From Json)

guys i have a json object in the database, i fetch it in the controller, I json decode it and send it to the view

in the view i can access non arrays but not arrays, when i try to loop over the array i get

ErrorException {#887 ▼
 #message: "Undefined property: stdClass::$pizzaIngredients"
 #code: 0
 #file: "/home/michalis/lampstack-7.3.15-1/apache2/htdocs/napoli/storage/framework/views/d94d939478afc34ce846dd7578959db73867d7af.php"
 #line: 152
 #severity: E_NOTICE
}

error

here is how i decode it in the controller

     foreach ($itemls as $item) {

        $item->attributes = json_decode($item->attributes);

     }

here is how i try to loop in view

@foreach($item->attributes->pizzaIngredients as $ingredient)

@endforeach

and if i dd it actually shows me that there is an array there

@dd($item->attributes)
{#469 ▼
  +"item_id": "29"
  +"size": "price_m"
  +"crust": "Regular"
  +"pizzaIngredients": array:4 [▶]
  +"pizzaExtraIngredients": array:1 [▶]
}
@dd($item->attributes->pizzaIngredients)
array:4 [▼
  0 => {#482 ▶}
  1 => {#487 ▶}
  2 => {#485 ▶}
  3 => {#488 ▶}
]

what am i doing wrong?

Feb
05
3 months ago
Activity icon

Started a new Conversation Git Pull Deletes .env File

hi guys, I bought a ready laravel script for a pizza shop, it was missing the gitignore file so when I commited it commited the .env

I added the .env file to gitignore and pushed, but .env was still in repository, i deleted it manually from repository but when I pull it deletes my local .env file

has anyone had this problem before? since .env is an ignored file, how do i stop git pull from removing it from my local copy?