Add breadcrumb support using Laravel Breadcrumbs package
- Install `diglactic/laravel-breadcrumbs` and update composer dependencies. - Configure breadcrumbs in `config/breadcrumbs.php`. - Define breadcrumbs for admin and site views. - Update base admin controller to include default breadcrumb view.
This commit is contained in:
@@ -3,8 +3,12 @@
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller as BaseController;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
Config::set('breadcrumbs.view', 'breadcrumbs::bootstrap4');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@ final class LanguagesController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly LanguageService $languageService,
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function newLanguage(NewLanguageRequest $request): JsonResponse
|
||||
{
|
||||
|
||||
@@ -13,7 +13,9 @@ final class AboutController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly AboutService $aboutService,
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function languages(int $project, Request $request): View
|
||||
{
|
||||
|
||||
+3
-1
@@ -16,7 +16,9 @@ final class DocumentationCategoriesController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly DocumentationCategoryService $documentationCategoryService,
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index(int $projectId, int $versionId, IndexRequest $request): View
|
||||
{
|
||||
|
||||
+3
-1
@@ -15,7 +15,9 @@ final class DocumentationVersionController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly DocumentationVersionService $documentationVersionService,
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index(int $projectId, IndexRequest $request): View
|
||||
{
|
||||
|
||||
@@ -16,7 +16,9 @@ final class DocumentationsController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly DocumentationService $documentationService,
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index(int $projectId, int $versionId, IndexRequest $request): View
|
||||
{
|
||||
|
||||
@@ -12,7 +12,9 @@ final class FeedbacksController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly FeedbackService $feedbackService,
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index(IndexRequest $request): View
|
||||
{
|
||||
|
||||
@@ -15,7 +15,9 @@ final class LinksController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly LinkService $linkService
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index(int $projectId, IndexRequest $request): View
|
||||
{
|
||||
|
||||
@@ -13,7 +13,9 @@ final class ServiceTranslateController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly ServiceTranslateService $serviceTranslateService,
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function view(int $projectId, Request $request): View
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Projects;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Admin\Controller;
|
||||
use App\Http\Requests\Admin\Projects\Translations\UpdateRequest;
|
||||
use App\Services\Admin\Project\TranslationService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
@@ -13,7 +13,9 @@ final class TranslationsController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly TranslationService $translationService,
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function languages(int $projectId, Request $request): View
|
||||
{
|
||||
|
||||
@@ -14,7 +14,9 @@ final class ProjectsController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly ProjectService $projectService
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index(IndexRequest $request): View
|
||||
{
|
||||
|
||||
@@ -14,7 +14,9 @@ final class RolesController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly RoleService $roleService
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
public function index(IndexRequest $request): View
|
||||
{
|
||||
$user = $request->user();
|
||||
|
||||
@@ -15,7 +15,9 @@ final class UsersController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UserService $userService
|
||||
) { }
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index(IndexRequest $request): View
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user