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

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.

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

How to redirect to a blade dashboard page from Vue login Component page after successfully login in laravel JetStream?

I created a laravel 8 project using jetstream authentication. As stack I have used inertia+vue. After successful login, I need to redirect to a blade file. But the problem is when I redirect to the blade file, the blade file opens as a modal like the image attached below. And the URL doesn't change (I mean the browser doesn't get refreshed). I would be grateful if you can suggest me the solution. Thanks in advance.
I eventually found this that allowed me to redirect to a page directly from a controller without it appearing in a modal—https://inertiajs.com/redirects#external-redirects.
Example:
return Inertia::location($url);

Loading Laravel blase views using Vue

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

Database in Joomla?

We put the program on the joomla article and we have the config.php located in the directory/images/php/config.php
I have 2 php pages that i want to include in joomla (pond.php and p_pond.php)
pond.php has a submit button, but when the submit button is clicked, it does not connect to database and it does not go to p_pond.php page
How can we connect to the database when the page is loaded?
Use JUMI component to use your personal PHP page and look at this page for database connection
Joomla works on MVC so you should follow the MVC rule.
For displaying a page you need to make a component.
read joomla docs to make component
here is the link http://docs.joomla.org/Developing_a_Model-View-Controller_Component/1.5/Introduction

Resources