public function getTypeNameAttribute() { $AmountRepository = new AmountRepository(); $names = $AmountRepository->type(); return $names[$this->attributes['pricing_type']]; }
public function scheduleInfo(Skill $skill) { $schedules = $skill->schedules()->get(); $scheduleRepository = new ScheduleRepository(); $amountRepository = new AmountRepository(); $serviceRepository = new ServiceRepository(); $amount_types = $amountRepository->type(); $amount_per_units = $amountRepository->per_units(); $amount_units = $amountRepository->units(); $week_days = $scheduleRepository->week_days(); $services_list = $serviceRepository->all(); $amounts = $skill->amounts()->get(); $areas = $skill->areas()->get(); $galleries = $skill->galleries()->get(); $services = $skill->services()->get(); $provinces = Province::where('parent_id', null)->lists('name', 'id'); $cities = Province::where('parent_id', null)->firstOrFail()->getDescendants()->lists('name', 'id'); return view('profile.newSkill', compact('skill', 'schedules', 'week_days', 'amounts', 'amount_types', 'amount_per_units', 'amount_units', 'areas', 'provinces', 'galleries', 'cities', 'services', 'services_list'))->with(['title' => 'ثبت مهارت جدید', 'new_skill' => 0, 'edit_skill' => 1, 'step' => 3, 'hasEdit' => 1]); }