how to print array in laravel blade
@php
var_dump($arr);
@endphp
how to print array in laravel blade
@php
var_dump($arr);
@endphp
Create and Print Array in Laravel
In App -> project.php modal file
// NOTE: service #1 : General Translation
public static function translationTypes()
{
return collect([
[
'id' => '1',
'en_title' => 'Medical',
],
[
'id' => '2',
'en_title' => 'General',
],
[
'id' => '3',
'en_title' => 'Commercial',
],
[
'id' => '4',
'en_title' => 'Literary',
],
]);
}
In Controller
$translationTypes = Project::translationTypes();
In View
@foreach($translationTypes as $translationType)
<option value="{{$translationType['id']}}">{{ $translationType['en_title'] }}</option>
@endforeach
how to print array in laravel blade
<?php dd($array); ?>
how to print array in laravel blade
echo implode("\n",$array);
how to print array in laravel blade
@foreach ($watchFolder as $key => $value)
Key: {{ $key }}
Value: {{ $value }}
@endforeach
how to print array in laravel blade
echo implode("\n",array_collapse($array));
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us