2014-03-05 4 views
0

나는이 모델 파일이 발견되지Laravel 4 모델은

<?php 
class IndexController extends BaseController { 

    public function showIndex() 
    { 
     $recipes = Recipe::all(); 
    return View::make('index',array('recipes' => $recipes)); 
    } 

} 

내가 시도 이 오류 메시지가 나타나는 페이지를 호출하십시오.

Symfony \ Component \ Debug \ Exception \ FatalErrorException 
Class 'Recipe' not found 

도 실행했습니다

composer dump-autoload 

무엇이 잘못 되었나요?

+0

정말 소스 코드가'

답변

4

Recipe.php를 직접 복사하여 붙여 넣는 경우.

<? php 
    class Recipe extends Eloquent{ 
     protected $table = 'recipes'; 
    } 

PHP 태그가 잘못되어 깨졌습니다. <?php이어야하며 <? php이 아니어야합니다. PHP 파일 대신 파일로 읽는 것입니다.

+1

오우 ... 미안 해요. – Daveman

+0

@Dounut all good! 우리에게 가장 좋은 일이 일어납니다. – Dibesjr