Feat: Create Common Dropdown file
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -20,5 +21,8 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
View::composer('*', function ($view) {
|
||||
$view->with('dropdowns', config('dropdowns'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
23
config/dropdowns.php
Normal file
23
config/dropdowns.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'activity_types' => [
|
||||
'GL' => 'GL (Guest Lecture)',
|
||||
'IC' => 'IC (Industry Connect)',
|
||||
'STTP' => 'STTP (Short Term Training Program)',
|
||||
],
|
||||
|
||||
'categories' => [
|
||||
'Technical' => 'Technical',
|
||||
'Social' => 'Social',
|
||||
'Entrepreneurial' => 'Entrepreneurial',
|
||||
'Life Skill' => 'Life Skill',
|
||||
],
|
||||
|
||||
'levels' => [
|
||||
'College' => 'College',
|
||||
'State' => 'State',
|
||||
'National' => 'National',
|
||||
'International' => 'International',
|
||||
],
|
||||
];
|
||||
@@ -75,29 +75,33 @@
|
||||
<label for="activity_type" class="block text-sm font-medium text-gray-700">Select Activity Type</label>
|
||||
<select name="activity_type" id="activity_type" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
<option value="">Select</option>
|
||||
<option value="GL">GL</option>
|
||||
<option value="IC">IC</option>
|
||||
<option value="STTP">STTP</option>
|
||||
@if(isset($dropdowns['activity_types']) && is_array($dropdowns['activity_types']))
|
||||
@foreach($dropdowns['activity_types'] as $key => $label)
|
||||
<option value="{{ $key }}">{{ $label }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="category" class="block text-sm font-medium text-gray-700">Select Category</label>
|
||||
<select name="category" id="category" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
<option value="">Select</option>
|
||||
<option value="Technical">Technical</option>
|
||||
<option value="Social">Social</option>
|
||||
<option value="Entrepreneurial">Entrepreneurial</option>
|
||||
<option value="Life Skill">Life Skill</option>
|
||||
@if(isset($dropdowns['categories']) && is_array($dropdowns['categories']))
|
||||
@foreach($dropdowns['categories'] as $key => $label)
|
||||
<option value="{{ $key }}">{{ $label }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="level" class="block text-sm font-medium text-gray-700">Select Level</label>
|
||||
<select name="level" id="level" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
<option value="">Select</option>
|
||||
<option value="College">College</option>
|
||||
<option value="State">State</option>
|
||||
<option value="National">National</option>
|
||||
<option value="International">International</option>
|
||||
@if(isset($dropdowns['levels']) && is_array($dropdowns['levels']))
|
||||
@foreach($dropdowns['levels'] as $key => $label)
|
||||
<option value="{{ $key }}">{{ $label }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user