<?php namespace App\Http\Controllers;
use App\Profile; // Profile Model
use Auth; // Auth model
use Illuminate\Http\Request;
class MyprofileController extends Controller {

	/*
	|--------------------------------------------------------------------------
	| MyProfile Controller
	|--------------------------------------------------------------------------
	|
	|
	*/

	/**
	 * Myprofile controller instance.
	 *
	 * @return void
	 */
	public function __construct()
	{
		$this->middleware('auth');
		//echo 55; exit;
                if(!Session::get('auth_selected_profile')) {
					//Session::put('user_type', 'O');
                                return Redirect::to('profile/step1')->with('succ_msg', 'Please Create atleast one profile')->send(); 
                             }
		
	}

	/**
	 * Show the application Step1 to the user.
	 *
	 * @return Response
	 */

	public function index()
	{
		$profiles = Profile::where('user_id','=',Auth::user()->id);
	    return view('myprofile.index')->with(['profiles'=>$profiles]);
	}

}
