Skip to content

Commit

Permalink
Merge pull request #139 from sarapis/feedback-changes
Browse files Browse the repository at this point in the history
Fix types of services and other routes issue
  • Loading branch information
d9it committed Mar 12, 2024
2 parents 696c9bd + 4b9d592 commit 620bafd
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 34 deletions.
7 changes: 4 additions & 3 deletions app/Http/Controllers/frontEnd/ExploreController.php
Expand Up @@ -376,7 +376,7 @@ public function filter(Request $request)
// $response = $geocoder->getCoordinatesForAddress($chip_address);
// $lat = $response['lat'];
// $lng = $response['lng'];
if(isset($lat) && isset($lng)){
if (isset($lat) && isset($lng)) {
$avarageLatitude = $lat;
$avarageLongitude = $lng;

Expand Down Expand Up @@ -974,8 +974,9 @@ public function filter(Request $request)
array_push($taxonomy_tree, $taxonomy_data);
}
} else {
$serviceCategoryId = TaxonomyType::orderBy('order')->where('type', 'internal')->where('name', 'Service Category')->first();
$parent_taxonomies = Taxonomy::whereNull('taxonomy_parent_name')->where('taxonomy', $serviceCategoryId ? $serviceCategoryId->taxonomy_type_recordid : '');
// $serviceCategoryId = TaxonomyType::orderBy('order')->where('type', 'internal')->where('name', 'Service Category')->first();
// $parent_taxonomies = Taxonomy::whereNull('taxonomy_parent_name')->where('taxonomy', $serviceCategoryId ? $serviceCategoryId->taxonomy_type_recordid : '');
$parent_taxonomies = Taxonomy::whereNull('taxonomy_parent_name');
$taxonomy_recordids = Taxonomy::getTaxonomyRecordids();
if (count($taxonomy_recordids) > 0) {
$parent_taxonomies->whereIn('taxonomy_recordid', $taxonomy_recordids);
Expand Down
6 changes: 4 additions & 2 deletions app/Http/Controllers/frontEnd/ServiceController.php
Expand Up @@ -332,14 +332,16 @@ public function index()
array_push($taxonomy_tree, $taxonomy_data);
}
} else {
$serviceCategoryId = TaxonomyType::orderBy('order')->where('type', 'internal')->where('name', 'Service Category')->first();
$parent_taxonomies = Taxonomy::whereNull('taxonomy_parent_name')->where('taxonomy', $serviceCategoryId ? $serviceCategoryId->taxonomy_type_recordid : '');
$serviceCategoryId = TaxonomyType::orderBy('order')->first();
$parent_taxonomies = Taxonomy::whereNull('taxonomy_parent_name');
$taxonomy_recordids = Taxonomy::getTaxonomyRecordids();
if (count($taxonomy_recordids) > 0) {
$parent_taxonomies->whereIn('taxonomy_recordid', $taxonomy_recordids);
}

$taxonomy_tree['parent_taxonomies'] = $parent_taxonomies->get();
}

$organizationStatus = OrganizationStatus::orderBy('order')->pluck('status', 'id');
return view('frontEnd.services.services', compact('services', 'locations', 'map', 'parent_taxonomy', 'child_taxonomy', 'checked_organizations', 'checked_insurances', 'checked_ages', 'checked_languages', 'checked_settings', 'checked_culturals', 'checked_transportations', 'checked_hours', 'meta_status', 'grandparent_taxonomies', 'sort_by_distance_clickable', 'service_taxonomy_info_list', 'service_taxonomy_badge_color_list', 'organization_tagsArray', 'layout', 'service_tagsArray', 'sdoh_codes_category_Array', 'sdoh_codes_Array', 'organizationStatus'))->with('taxonomy_tree', $taxonomy_tree);
}
Expand Down
1 change: 0 additions & 1 deletion app/Providers/ComposerServiceProvider.php
Expand Up @@ -140,7 +140,6 @@ public function boot()
$organization_tagsArray = OrganizationTag::get();
$organization_tagsArray = json_encode($organization_tagsArray);

// $parent_taxonomies = Taxonomy::whereNull('taxonomy_parent_name')->whereNotNull('taxonomy_services')->get();
$layout = Layout::first();
$view->with(compact('layout', 'taxonomy_tree', 'organization_tagsArray'));
});
Expand Down
2 changes: 1 addition & 1 deletion app/Services/TaxonomyService.php
Expand Up @@ -60,7 +60,7 @@ public function import_airtable_v3(string $access_token, string $base_url)
foreach ($parent_names as $key => $parent_name) {
$parent_name_ids[] = $strtointclass->string_to_int($parent_name);
}
$taxonomy->taxonomy_parent_name = implode(',', $parent_name_ids);
$taxonomy->taxonomy_parent_name = count($parent_name_ids) > 0 ? implode(',', $parent_name_ids) : null;

// $taxonomy->taxonomy_vocabulary = isset($record['fields']['vocabulary']) ? $record['fields']['vocabulary'] : null;
// $taxonomyName = isset($record['fields']['taxonomy']) ? $record['fields']['taxonomy'] : '[]';
Expand Down
11 changes: 0 additions & 11 deletions resources/views/layouts/sidebar.blade.php
Expand Up @@ -113,17 +113,6 @@

{{-- <nav id="sidebar"> --}}
<nav id="">
{{-- <ul class="list-unstyled components pt-0 mb-0 sidebar-menu">
<li class="option-side">
<button class="btn btn-block waves-effect waves-classic" style="padding: 0;background: #A2E9FF;"><a href="/services" style="display: block;padding-left: 10px;">Services</a></button>
</li>
<li class="option-side">
<button class="btn btn-block waves-effect waves-classic" style="padding: 0;background: #A2E9FF;"><a href="/organizations" style="display: block;padding-left: 10px;">Organizations</a></button>
</li>
<li class="option-side">
<button class="btn btn-block waves-effect waves-classic" style="padding: 0;background: #A2E9FF;"><a href="/about" style="display: block;padding-left: 10px;">About</a></button>
</li>
</ul> --}}

<ul class="list-unstyled components pt-0">
@if ((Request::path() == 'services') || (Request::segment(1) == 'search') || (Request::segment(1) == 'services') || (Request::segment(1) == 'organizations') || (Request::segment(1) == 'services_near_me') || (Request::segment(1) == 'organizations'))
Expand Down
28 changes: 12 additions & 16 deletions routes/web.php
Expand Up @@ -2,7 +2,7 @@

use App\Http\Controllers\AccountController;
use App\Http\Controllers\backend\AddressTypeController;
use App\Http\Controllers\backEnd\AnalyticsController;
use App\Http\Controllers\backend\AnalyticsController;
use App\Http\Controllers\backend\CityController;
use App\Http\Controllers\backend\CodeCategoryController;
use App\Http\Controllers\backend\CodeLedgerController;
Expand All @@ -14,10 +14,10 @@
use App\Http\Controllers\backend\DataController;
use App\Http\Controllers\backend\DetailTypeController;
use App\Http\Controllers\backend\DispositionController;
use App\Http\Controllers\backEnd\EditaboutController;
use App\Http\Controllers\backEnd\EdithomeController;
use App\Http\Controllers\backEnd\EditlayoutController;
use App\Http\Controllers\backEnd\EditLoginRegisterController;
use App\Http\Controllers\backend\EditaboutController;
use App\Http\Controllers\backend\EdithomeController;
use App\Http\Controllers\backend\EditlayoutController;
use App\Http\Controllers\backend\EditLoginRegisterController;
use App\Http\Controllers\backend\EditsController;
use App\Http\Controllers\backend\EmailController;
use App\Http\Controllers\backend\ExportController;
Expand All @@ -33,14 +33,14 @@
use App\Http\Controllers\backend\OrganizationTagsController;
use App\Http\Controllers\backend\OrganizationTypeController;
use App\Http\Controllers\backend\OtherAttributesController;
use App\Http\Controllers\backEnd\PagesController;
use App\Http\Controllers\backend\PagesController;
use App\Http\Controllers\backend\PhoneTypeController;
use App\Http\Controllers\backend\PoliticalPartyController;
use App\Http\Controllers\backend\ProgramController;
use App\Http\Controllers\backend\RegionController;
use App\Http\Controllers\backend\RegistrationController;
use App\Http\Controllers\backend\ReligionsController;
use App\Http\Controllers\backEnd\RoleController;
use App\Http\Controllers\backend\RoleController;
use App\Http\Controllers\backend\ServiceAreaController;
use App\Http\Controllers\backend\ServiceAttributeController;
use App\Http\Controllers\backend\ServiceCategoryController;
Expand All @@ -52,7 +52,7 @@
use App\Http\Controllers\backend\StateController;
use App\Http\Controllers\backend\TaxonomyTypeController;
use App\Http\Controllers\backend\UploadController;
use App\Http\Controllers\backEnd\UserController;
use App\Http\Controllers\backend\UserController;
use App\Http\Controllers\backend\XDetailsController;
use App\Http\Controllers\CronController;
use App\Http\Controllers\frontEnd\AboutController;
Expand Down Expand Up @@ -124,12 +124,8 @@

Route::post('/fetchService', [ExploreController::class, 'fetchService'])->name('services.fetch');
Route::post('/fetchOrganization', [ExploreController::class, 'fetchOrganization'])->name('organizations.fetch');
Route::match(['get', 'post'], '/search', [
'uses' => [ExploreController::class, 'filter'],
]);
Route::match(['get', 'post'], '/search_organization', [
'uses' => [ExploreController::class, 'filter_organization'],
]);
Route::match(['get', 'post'], '/search', [ExploreController::class, 'filter']);
Route::match(['get', 'post'], '/search_organization', [ExploreController::class, 'filter_organization']);
Route::get('/services_near_me', [ExploreController::class, 'geolocation'])->name('services_near_me');
Route::group(['middleware' => ['web', 'OrganizationAdmin']], function () {

Expand Down Expand Up @@ -284,7 +280,7 @@
// admin route

Route::group(['middleware' => ['web', 'auth', 'permission']], function () {
Route::get('dashboard', ['uses' => 'HomeController@dashboard', 'as' => 'home.dashboard']);
Route::get('dashboard', [HomeController::class, 'dashboard'])->name('home.dashboard');
Route::get('messagesSetting', [MessageController::class, 'messagesSetting'])->name('messagesSetting.index');
Route::resource('dashboard_setting', DashboardEditController::class);
Route::resource('pages', PagesController::class);
Expand Down Expand Up @@ -457,7 +453,7 @@
// });

//export section
Route::get('/export_services', ['uses' => [ServiceController::class, 'export_services']])->name('export.services');
Route::get('/export_services', [ServiceController::class, 'export_services'])->name('export.services');
// Route::post('/export_locations', ['uses' => 'frontEnd\LocationController@csv'])->name('export.locations');
// Route::post('/export_organizations', ['uses' => [OrganizationController::class, 'csv']])->name('export.organizations');
// Route::post('/export_contacts', ['uses' => 'frontEnd\ContactController@csv'])->name('export.contacts');
Expand Down

0 comments on commit 620bafd

Please sign in to comment.