Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

warpig's avatar
Level 12

Make blade view behave like a partial

I want to link to another page from an href that I have in index but I want this page to be more like a partial of the previous screen so other components are shared, in this case first I have the index then roles, both of these views are nested within the users folder and index is wrapped around another blade component, the structure looks like this:

admin
- uploads.blade.php
	- users
		- index
		- roles

index.blade.php

<x-app-layout>

    <x-slot name="header">
        <div>
            <a href="{{ route('roles') }}>
                Roles
            </a>
        </div>
    </x-slot>

    <div>
        <div>
            <div>
                 
                <div>
                    <h1>List of users</h1>
                </div>

            </div>
        </div>
    </div>

</x-app-layout>

Main reason why I want to do this is because I don't want to have the roles view to have the header component that you can see from the index, would like to call it like a Livewire component that refreshes and only the right stuff loads.

0 likes
1 reply
jlrdw's avatar

You could use a view composer. You don't necessarily need it as a view, just have that data used where needed. Otherwise you have the header.

Please or to participate in this conversation.