2017-11-18 10 views
0

매번 존재하지 않는ReflectionException 클래스 UserController는 ReflectionException 클래스 UserController이 존재하지 않는 Laravel5.4에게 내가이 문제를 가지고 제출 버튼을 누르면

<?php 
namespace app\Http\Controllers; 
    use App\User; 
    use Illuminate\Http\Request; 




    class UserController extends Controller { 

    public function postSignUp(Request $request) 
     { 
     $email = $request['email']; 
     $first_name = $request['first_name']; 
     $password = bcrypt($request['password']); 
     $user = new User(); 
     $user->email =$email; 
     $user->first_name=$first_name; 
      $user->password = $password; 
      $user->save(); 

      return redirect()->back(); 

        } 

       public function postSignIn(Request $request) 
        { 

         } 
         } 

내 경로 파일 : 당신이 사용

<?php 

namespace App\Providers; 

use Illuminate\Support\Facades\Route; 
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; 


class RouteServiceProvider extends ServiceProvider 
{ 
    /** 
    * This namespace is applied to your controller routes. 
    * 
    * In addition, it is set as the URL generator's root namespace. 
    * 
    * @var string 
    */ 
    protected $namespace = 'App\Http\Controllers'; 

    /** 
    * Define your route model bindings, pattern filters, etc. 
    * 
    * @return void 
    */ 
    public function boot() 
    { 
     // 

     parent::boot(); 
    } 

    /** 
    * Define the routes for the application. 
    * 
    * @return void 
    */ 
    public function map() 
    { 
     $this->mapApiRoutes(); 

     $this->mapWebRoutes(); 

     // 
    } 

    /** 
    * Define the "web" routes for the application. 
    * 
    * These routes all receive session state, CSRF protection, etc. 
    * 
    * @return void 
    */ 
    protected function mapWebRoutes() 
    { 
     Route::middleware('web') 
      ->namespace($this->namespace) 
      ->group(base_path('routes/web.php')); 


     Route::post('/signup',[ 
      'uses'=>'[email protected]', 
      'as'=>'signup' 
     ]); 



    } 

    /** 
    * Define the "api" routes for the application. 
    * 
    * These routes are typically stateless. 
    * 
    * @return void 
    */ 
    protected function mapApiRoutes() 
    { 
     Route::prefix('api') 
      ->middleware('api') 
      ->namespace($this->namespace) 
      ->group(base_path('routes/api.php')); 
    } 
} 

답변

0

잘못된 네임 스페이스. 대신에 : 당신의 UserController에

namespace app\Http\Controllers; 

당신은 사용해야 그런

namespace App\Http\Controllers; 
+0

을 시도 –

+0

나는 그 prob 름 파일이 경로 파일 –

+0

에서 나온 것입니다. 'composer dump-autoload'도 실행하십시오. –

0
namespace App\Http\Controllers; 
use Illuminate\Http\Request; 

사용 namespace을 내가 같은 오류가 명령을 php artisan route:cache

php artisan route:clear