app/Http/Controllers/ServicesController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create(Request $req)
    {
        $customers = Auth::user()->customers()->get();
        $providers = Auth::user()->providers()->get();
        $service_types = Auth::user()->serviceTypes()->get();
        $renewal_frequencies = Auth::user()->renewalFrequencies()->get();
        $service = new Service;
        $renewal = new Renewal;
        if($req->has('cid')){
            $service->customer_id = $req->input('cid');
        }
        return view('services.create', compact('service', 'renewal', 'providers', 'service_types', 'renewal_frequencies', 'customers'));
    }
public function create ( Request $ req ) { $ customers = Auth :: user ( ) -> customers ( ) -> get ( ) ; $ providers = Auth :: user ( ) -> providers ( ) -> get ( ) ; $ service_types = Auth :: user ( ) -> serviceTypes ( ) -> get ( ) ; $ renewal_frequencies = Auth :: user ( ) -> renewalFrequencies ( ) -> get ( ) ; $ service = new Service ; $ renewal = new Renewal ; if ( $ req -> has ( 'cid' ) ) { $ service -> customer_id = $ req -> input ( 'cid' ) ; } return view ( 'services.create' , compact ( 'service' , 'renewal' , 'providers' , 'service_types' , 'renewal_frequencies' , 'customers' ) ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .