Loading Laravel blase views using Vue - laravel

I have a Laravel project with a dashboard that contains a side menu. When navigating through this side menu, it refreshes the whole page (layout & view in blade). This is my dashboard:
1
I want to know how I'm able to load my blade views without page refresh. So that when I'm clicking on a navigation link, only the yielded content changes. How am I able to achieve this? Please don't mark this as a dublicate as I've visited most of the similar topics but without any succes.
Oh, and I'd appriciate it so bad if there's someone that's willing to help me out using Teamview.

views cannot be loaded that way with laravel. you will need to use components to design your pages with vue. with components in place you can now use vuerouter to load your pages that way.

Run php artisan preset vue to start your project using Vue.
To access a menu link without refresh the page, use <route-link to="..."></route-link>
https://router.vuejs.org/guide/#html

Related

Is it possible to navigate through page by navbar without page refresh with Laravel Livewire and AlpineJS?

I am just wondering whether it's possible to navigate through navigation without any page refresh using Laravel Livewire and AlpineJS? I also want to keep the state of the clicked link of the navbar, so I can change it's color.
Thanks

Intertia modal - load view into a model for create, edit etc

Im using Laravel 9 with inertia. The design of the project includes modals for creating, updating but i see that inertia doesnt have support for modals?
I have found a few projects for inertia modals but they dont seem to work.
Currently when you navigate using inertia, Laravel hits the route and then in the controller you render an inertia page and vue knows to find a specific page and then navigates to that new page (loads it in a new vue page)
I am wanting to do the same but instead of a new page loaded i want to remain on the same parent page and load the new route content into a modal.
Thanks
If you want a blade view to be loaded inside a modal in an Inertia page you can do:
$modalContent = view('your-blade-view-name', $modalData)->render();
return Inertia::render('inertia-page', $inertiaData);
I created a demo repository for this

Layout is broken after login or logout, Laravel and Vue.js

I am developing an application using Vue.js and Laravel JetStream. My problem is that when i login the layout of the main page is broken and after the refresh it fixes:
This is how it should look:
This also happens when I logout from this layout, If I login and land on another page the layout loads correctly. I checked the network data on Chrome and the problem is that it doesn't load the css and js at all. I don't know why it happens.
Thanks in advance.

Accessing database data in Laravel Spark kiosk settings

I have added a new page under kiosk settings under API keys. On my new panel I have a select box and I need to populate it with values from a database table.
I'm not sure how to best do this. There seems to be this Spark.state object where the user and team values are put, so if I guess this might be a place.
Or else I load it with Ajax???
This is so easy in normal Laravel I just pass the object from the controller to the view and build the box on the blade view.
Am I missing something? How would i best do this?
Thanks
The way Spark is built with inline-templates, you can still use blade like normal.
You've created the new link in the menu sidebar, so now copy what the other settings are doing by having a tabcard be displayed when the menu item is clicked.
I recommend creating a new blade file for your new menu item and including it in that tabcard. You'll see some examples in the Spark settings blade file. Because you're using blade to render it, you don't need to load anything through AJAX.

php page to be included in joomla

I have written a php page that is getting data from a database and graph it via highcharts javascript.
I would like now to be able to put that in joomla and then use the username from joomla to graph the specific data from that user.
How can I do that?
Thanks for your help,
John.
You should use an iFrame Wrapper menu item whenever you want to include a page that isn't part of your Joomla website.

Resources