<?php


namespace Mehrab\Front\Http\Controllers;


use App\Http\Controllers\Controller;
use Mehrab\Service\Repositories\ServiceRepo;


class ServiceInfoController extends Controller
{
    public function index($slug){
        $serviceRepo = new ServiceRepo();
        $service = $serviceRepo->findBySlug_front_info($slug,['service_comment']);
        $otherService = $serviceRepo->other_services();
        $footer = false;
        return view('Front::serviceInfo',compact('service','otherService','footer'));
    }

    public function parent($slug){
        $serviceRepo = new ServiceRepo();
        $footer = false;
        list($service,$children) = $serviceRepo->findBySlug_front_parent($slug);
        return view('Front::service',compact('service','footer','children'));
    }

}
