1 | <?php |
||||
2 | |||||
3 | namespace TaskManager; |
||||
4 | |||||
5 | use Illuminate\Database\Eloquent\Model; |
||||
6 | |||||
7 | class Tasks extends Model |
||||
8 | { |
||||
9 | protected $fillable = [ 'task', 'complete','user_id']; |
||||
10 | |||||
11 | public function user() |
||||
12 | { |
||||
13 | return $this->belongsTo('\TaskManager\User', 'user_id'); |
||||
14 | } |
||||
15 | public function setCompleteAttribute($value){ |
||||
16 | $this->attributes['complete'] = $value ?? false; |
||||
17 | } |
||||
18 | public function setUserIdAttribute($value){ |
||||
0 ignored issues
–
show
|
|||||
19 | $this->attributes['user_id'] = auth()->id(); |
||||
0 ignored issues
–
show
The method
id() does not exist on Illuminate\Contracts\Auth\Factory .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||
20 | } |
||||
21 | } |
||||
22 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.