samedi 3 mars 2018

PHP Fatal error: Class 'App\Http\Controllers\View' not found In Laravel 5

Please Help To Solve This Problem

My Controller

<?php namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesCommands;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Http\Request;
use View;
use DB;



class MyCon extends Controller {

/*
|--------------------------------------------------------------------------
| Welcome Controller
|--------------------------------------------------------------------------
|
| This controller renders the "marketing page" for the application and
| is configured to only allow guests. Like most of the other sample
| controllers, you are free to modify or remove it as you desire.
|
*/

/**
 * Create a new controller instance.
 *
 * @return void
 */
public function __construct()
{
    $this->middleware('guest');
}

/**
 * Show the application welcome screen to the user.
 *
 * @return Response
 */


public function register()
{
  //return \View::make('pages.Register');
    return view('pages.Register');
}

public function RegisterAction(Request $req)
{

    $name = $req->input('name');
    $email = $req->input('email');
    $gender = $req->input('gender');
    $password = $req->input('password');
    $data = array("uname" => $name, "uemail" => $email, "ugender" => $gender, "upassword" => $password);
    DB::table('user')->insert($data);
    //return \View::make('pages.Register');

}



}

My Register Function work fine But When I am Submit Form ON RegisterAction function then show error like 'PHP Fatal error: Class 'App\Http\Controllers\View' not found'

My Router Code

Route::post('RegisterAction', 'MyCon@RegisterAction');

Please Help To Solve This Problem. Thank In Advance



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire