Feat: Create Common Dropdown file
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Illuminate\Support\Facades\View;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@@ -20,5 +21,8 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
public function boot(): void
|
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>
|
<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>
|
<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="">Select</option>
|
||||||
<option value="GL">GL</option>
|
@if(isset($dropdowns['activity_types']) && is_array($dropdowns['activity_types']))
|
||||||
<option value="IC">IC</option>
|
@foreach($dropdowns['activity_types'] as $key => $label)
|
||||||
<option value="STTP">STTP</option>
|
<option value="{{ $key }}">{{ $label }}</option>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="category" class="block text-sm font-medium text-gray-700">Select Category</label>
|
<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>
|
<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="">Select</option>
|
||||||
<option value="Technical">Technical</option>
|
@if(isset($dropdowns['categories']) && is_array($dropdowns['categories']))
|
||||||
<option value="Social">Social</option>
|
@foreach($dropdowns['categories'] as $key => $label)
|
||||||
<option value="Entrepreneurial">Entrepreneurial</option>
|
<option value="{{ $key }}">{{ $label }}</option>
|
||||||
<option value="Life Skill">Life Skill</option>
|
@endforeach
|
||||||
|
@endif
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="level" class="block text-sm font-medium text-gray-700">Select Level</label>
|
<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>
|
<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="">Select</option>
|
||||||
<option value="College">College</option>
|
@if(isset($dropdowns['levels']) && is_array($dropdowns['levels']))
|
||||||
<option value="State">State</option>
|
@foreach($dropdowns['levels'] as $key => $label)
|
||||||
<option value="National">National</option>
|
<option value="{{ $key }}">{{ $label }}</option>
|
||||||
<option value="International">International</option>
|
@endforeach
|
||||||
|
@endif
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user