for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Chriscreates\Blog\Traits;
use Illuminate\Support\Facades\Auth;
trait IsAuthorable
{
public function author()
return $this->belongsTo(
belongsTo()
Chriscreates\Blog\Traits\IsAuthorable
bootBelongsToUser()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
config('blogs.user_class'),
'user_id',
config('blogs.user_key_name')
);
}
public function user()
public static function bootBelongsToUser()
static::saving(function ($model) {
$model->user_id = $model->user_id ?? Auth::id();
});
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.