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...
thanks....
public function test()
is not a static method. When you try to access a static method withTag::test()
it will fail, because.. well the method isn't static.You have two options:
1) Set your method to static
2) Invoke it as an instance method by first instantiating your class: