<?php namespace App\Http\Controllers;
use Auth; // Auth model
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Input;
use App\Legal;
use App\User;
use Validator;
use URL;
class LegalController extends Controller {

	/*
	|--------------------------------------------------------------------------
	| Search Controller
	|--------------------------------------------------------------------------
	|
	|
	*/

	/**
	 * Search controller instance.
	 *
	 * @return void
	 */
	public function __construct()
	{
		
		
	}

	public function index($leg_id)
        { 
           if(is_numeric($leg_id)):
            $page = Legal::where('id','=',$leg_id)->get();
                if(isset($page[0])):
                     return view('page.legal_view')->with(['page'=>$page[0]]);  
                else:
                    return Redirect::to('/legal')->with('error_msg',"Invalid Request");   
                endif;
          else:
                return Redirect::back()->with('error_msg',"Invalid Request");   
          endif;
       }
}
