불만 사항이 있지만 불일치라는 새로운 모델을 추가했습니다. 응답을 얻을 스피 수 위의 코드에서laravel 4에 새 모델을 추가하는 방법은 무엇입니까?
$users = DB::table('complaints')->get(); return $users;
하지만 아래의 코드 못하고 오류
$users = Compliant::all(); return $users;
Complaints.php
를 사용하는 경우<?php use Illuminate\Auth\UserTrait; use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class Complaint extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
protected $table = 'complaints';
public $timestamps = false;
function static function uploadComplaint($data){
return $data;
}
}
'Complaints.php'에 어떤 코드를 넣었습니까? –
컨트롤러 (Complaints.php)가 BaseController를 확장합니까? – MartaGom
' php 조명 사용 \ Auth \ UserTrait; Illuminate \ Auth \ UserInterface를 사용하십시오. Illuminate \ Auth \ Reminders \ RemindableTrait를 사용하십시오. Illuminate \ Auth \ Reminders \ RemindableInterface를 사용하십시오. 클래스 불만 사항 확장 Eloquent implements UserInterface, RemindableInterface { \t UserTrait, RemindableTrait; \t 보호 된 $ table = 'complaints'; \t public $ timestamps = false; \t \t 기능 정적 함수 uploadComplaint ($ data) { \t \t \t \t return $ data; \t \t} \t} ?> – Nagesh