2017-01-24 2 views
0

필자는 Windows 환경에서 laravel 블로그를 로컬로 내 시스템에 만들었습니다. 지금 현재의 오류는 다음과 같은 말을되도록, 소문자로 내 테이블 이름을 내 로컬 환경에서소문자 테이블 이름이 서버에서 작동하지 않습니다.

enter image description here

: 내가 라이브 서버에 내 파일을 업로드 할 때 지금, 나는 다음과 같은 오류가

'peckinga_blog.Admin' doesn't exist (SQL: select * from `Admin` order by `created_at` desc limit 10) 

실제로 내 테이블 이름은 peckinga_blog.admin이 아니라 peckinga_blog.Admin입니다. 오류가 표시됩니다. 그래서 어떻게 소문자 테이블 이름을 찾는 laravel을 얻을 수 있습니까 ??

P.는 : - 내 .env 파일에서

APP_DEBUG=true 

나는 temporaryly folllowing을 사용할 수있다.

답변

0

Windows에서 데이터베이스 및 테이블 이름은 대/소문자를 구분하지 않으며 대부분의 유닉스에서는 대/소문자를 구분합니다. 당신이 모델에 대한 몇 가지 작업을 수행하는 경우

In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory. Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and table names.

0

당신은이처럼 내부에 테이블 이름을 지정할 수 있습니다

<?php 

namespace App; 

use Illuminate\Database\Eloquent\Model; 

class Flight extends Model 
{ 
    /** 
    * The table associated with the model. 
    * 
    * @var string 
    */ 
    protected $table = 'my_flights'; 
} 

Documentation

관련 문제