loop object property laravel code example Example: loop object property laravel foreach( $project->toArray() as $key => $value ) { echo $key; }