mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
Leverage injected request object
Laravel automatically injects the current Http [request object][1] to all Controller actions and Middleware. Leveraging this object improves consistency and testability. [1]: https://laravel.com/docs/requests#accessing-the-request
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Events\UserLoggedIn;
|
||||
use App\Models\Category;
|
||||
use App\Models\Forumpost;
|
||||
@@ -107,9 +108,9 @@ class BasePageController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
public function isPostBack(): bool
|
||||
public function isPostBack(Request $request): bool
|
||||
{
|
||||
return \request()->isMethod('POST');
|
||||
return $request->isMethod('POST');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user