BadMethodCallException with message 'Call to undefined method Illuminate\Database\Query\Builder::incomplete()'

Posted 1 year ago by DanielGG

I get this error when I try to call the function incomplete from my Task model using tinker.

Code:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;



class Task extends Model
{
    public static function incomplete()
    {
        return static::where('completed','=',0)->get();
    }
}

Command i'm using in php artisan Tinker:

App\Task::incomplete()

Can't seem to fix it

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.