Profile picture requires reload to change - caching

I'm having problem with my PHP application. People can upload a profile photo to show on their profile page. The problem is that once the photo is uploaded you need to refresh the page in order for the photo to change.
I'm redirecting the user back (after the upload succeeded) to the previous page with Laravel's redirect function, like so:
return Redirect::to("/user/". $id . "/edit");
I assume the photo is saved in the cache and needs to be refreshed? But that would be weird because when I redirect it actually "refreshes" the page.
Any help would be appreciated.
Thanks

You can cache-bust the image by attaching a random variable to the image url:
Cache Busting Files

Related

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);

I setup on local but when I run code I giving 404 error

I attached image that what is showing. When I logged in after that it redirect to home page but here 404 error is showing. And I am new in Laravel and I don't have any idea what I should do and see lots of video regarding this and sped lot of time but 0 result.
#sabia Can you also share your, probably, HomeController. Or it looks like it is already wanting to go to some sort of shopping cart? So not after login anymore?
Or... if it does happen after login, your Auth\LoginController probably

Problem with joomla with photos and redirection

I deleted the pictures through the Joomla panel and I get such an error on the page as you can see in the picture. How to deal with this?
How to add redirection but without domain?
Your first issue about the pictures seems to be an issue with the component you're using, which is com_joomgallery in your case. When you delete the picture, it gets deleted but somehow its showing up in your JoomGallery image listing and so is the error.
Can you let me know from where you've deleted the photos? Was it from JoomGallery or from somewhere else?
If you haven't deleted them from JoomGallery then that's the reason for your issue, because JoomGallery database table still have those records and when it tries to list them its unable to find the thumbnails/images that you've deleted.
About your second question, how are you redirecting to external URL? If you're trying to open the external URL from an anchor tag try doing it like
Link
But you're using Route::_ to open the external URL, then don't. As Route::_ isn't used for external links but is meant only for internal URLs. If you want to open or redirect using Joomla, then try like this
$url = Uri::getInstance("//www.facebook.com");
$url->setScheme("https");
$externalURL = $url->toString();
echo "<a href='$externalURL'>Link</a><br>";
I hope this helps.

User Is Logged Out When Generating PDF with DomPDF & Joomla 2.5

I have integrated DomPDF with a Joomla site that I am working on. I followed the Creating PDF Views article to achieve this and generating PDFs works well except that when the link is clicked and the PDF is generated from the component the user is logged out. I am using Joomla 2.5 & DomPDF 0.6.0 beta 3, the content for the PDF is generated from a custom component but right now it is just flat HTML and follows the instructions in the article for generating the view. I have looked at the code but can't seem to see where the problem is. Any help is greatly appreciated.
EDIT: The user does not get logged out if 'Remember Me' is checked on login. Also didn't mention that I am using Database as the setting for sessions.
Check the custom component that clearing the user object or not.
Any where session_destroy() or unset($user) or any other Factory call to reset the user object.If you can't find such a statement then the make sure the problem with that PDF creation.
In no way you can't get solution then try this.
Before creating PDF section current logged user object id set to Cookie you mentioned that it was not clearing remember me option.
$user = &JFactory::getUser();
echo $user->id //current logged user id.
and the process PDF again put it back to user object like.
$user = &JFactory::getUser($user_id);//from cookie.
This is not a perfect fix but your problem will solve.
Hope this will help..

Magento - home page url

i have a two store magento installation, and i have a problem with home page's url: in both stores the home is a cms page, in cms.xml layout the route for that is cms_index_index. this seems to be a problem in one of the stores, which has a complete different layout for logged and non logged users: after loggin in, the url from www.mystore.com becomes www.mystore.com/index.php/cms/index/index/, if i logout the url remains www.mystore.com/index.php/cms/index/index/. i need that the store url remain www.mystore.com. how can i do that? is something that could be done with xml or other magento configuration or is something related to other (e.g. apache, rewrite,...)?
thanks,
Luke
The problem probably lies in the template files.
There are different ways of getting the homepage url (and it's probably using one that's not helpful for you).
Here is the correct call that should be made from the templates:
Mage::getBaseUrl();
This call can be done from anywhere - just make sure to echo it.
Pesach

Resources