jeudi 26 novembre 2015

Laravel5 - Non-static method should not be called statically

I don't know what is this error. Please someone give me some explaination

on my UserController.php

class UserController extends Controller {
    public function viewCard($card_id) {
        return Tag::test($card_id);
    }
}

and on my model Tag.php

class Tag extends Model {
    public function test($card_id){
        return DB::SELECT(DB::RAW("SELECT name FROM tagmap tm, tags t WHERE t.id = tm.tag_id AND tm.card_id = :card_id"), ['card_id'=>$card_id]);
    }
}

i don't know where it fails, where I do wrong...



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire