<?php
namespace App;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use PouyaParsaei\LaravelToDo\Traits\HasTasks;
use PouyaParsaei\LaravelToDo\Traits\HasToken;
class User extends Authenticatable
{
use Notifiable, HasTasks, HasToken;
}
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use PouyaParsaei\LaravelToDo\Helpers\ResponseHelper;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Database\Eloquent\ModelNotFoundException as IlluminateModelNotFoundException;
use Throwable;
class Handler extends ExceptionHandler
{
use ResponseHelper;
public function render($request, Throwable $exception)
{
if (($exception instanceof NotFoundHttpException || $exception instanceof IlluminateModelNotFoundException) && $request->wantsJson()) {
return $this->respondNotFound(trans('todo::messages.errors.not found'));
}
return parent::render($request, $exception);
}
}