app/Http/Controllers/Tutor/SessionsController.php
/**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Session  $session
     * @return \Illuminate\Http\Response
     */
Show the form for editing the specified resource.
Show the form for editing the specified resource .
public function edit(Session $session)
    {
        $myuser = Auth::User();
        $students = Array();
        foreach($myuser->tutor_assignments()->get() as $assignments)
        {
            $students[] = $assignments->student();
        }
        $students = array_unique($students);
        $data = [
            'session'   => $session,
            'students'  => $students,
            'durations' => Session::getAllDurations()
        ];
        return view('tutor.sessions.edit') -> with('data', $data);
    }
public function edit ( Session $ session ) { $ myuser = Auth :: User ( ) ; $ students = Array ( ) ; foreach ( $ myuser -> tutor_assignments ( ) -> get ( ) as $ assignments ) { $ students [ ] = $ assignments -> student ( ) ; } $ students = array_unique ( $ students ) ; $ data = [ 'session' => $ session , 'students' => $ students , 'durations' => Session :: getAllDurations ( ) ] ; return view ( 'tutor.sessions.edit' ) -> with ( 'data' , $ data ) ; }
Show the form for editing the specified resource.
Show the form for editing the specified resource .