How to Pass PHP Variable to JavaScript in Laravel

Sometimes, you may need to pass certain PHP variables to JavaScript code in a Blade template or even to a separate JavaScript file that is imported into the template. In this short article, I will show you how to pass PHP variable to JavaScript in Laravel and avoid errors in the JavaScript console. How to … Read more

How to Redirect with Message in Laravel

Redirecting to the previous page after doing an action is common practice in Laravel projects. However, If there is an error while performing the action, you need to inform the user about it. You can return the result in the API response if creating a SPA application. Although, if you have an application rendered using … Read more