mohammad-ammad / registration_pk_web_app

0 stars 0 forks source link

Edit & delete feature in Manage location #1

Open mohammad-ammad opened 11 months ago

mohammad-ammad commented 11 months ago

Task is split into the following parts

--------------IMPORTANT-------------------

  1. Code should be neat and clean.
  2. well commented if required.
  3. Tested before pushing to the branch level.
salihumar660 commented 11 months ago

return view("admin.pages.edit_school")->with('provinces', $province)->with('school', $school); sir after view file path ->with ->with('provinces', $province)->with('school', $school) i didnt understand this.

salihumar660 commented 11 months ago

sir theres no table of location in db kindly tell me in which tble the location is inserted

mohammad-ammad commented 11 months ago

Here is the quick hint !!

  1. First create route in web.php like route::get('/location/edit/{province_id}/{district_id}/{tehsil_id}/{city_id}/{area_id}/{subarea_id}', [controller::class, 'edit view']);

  2. Second in the edit_view controller function apply this logic.

    public function edit_view($province_id,district_id,tehsil_id,city_id,area_id,subarea_id) {
        $province = Province::where('province_id',$province_id)->get();
        $district = District::where('district_id',$district_id)->get();
       // same for rest of the models
    
      // next step is to show dropdown data
      $all_provinces = Province::get();
      // same for rest of the models
        return view("admin.pages.edit_location")->with('province', $province)->with('district', $district);
    }

---------- NOTE -------------

salihumar660 commented 11 months ago

sir i have done it till get data from model for each and now for dropdown ..