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