How to Get Current URL Inside Blade Templates
In this article, we will discuss how to get the current URL inside Blade templates. We can use the request() global helper function or the Request helper Class. In conclusion, getting the...
In this article, we will discuss how to get the current URL inside Blade templates. We can use the request() global helper function or the Request helper Class. In conclusion, getting the...
Let’s quickly look at how we can set variables in Blade templates. Here we have some simple HTML where we output the name John Doe. But we want to store this name inside a...
Let’s quickly look at how we can use the ternary operator in Blade templates. Here we have a simple good old if/else statement. If the login route exists, display ‘Yes’; if it doesn’t, display...
Let’s look at how we can check if a route exists in a Laravel project. We’re going to use the has() method from the Route facade. Note that it tries to find the...
Let’s imagine the following scenario. You’re working on a monolith or a macroservice project. And a mobile app developer comes to you and says: – Hey, can you help me debug this API endpoint?...
Let’s look at 3 simple methods to check if debug mode is enabled in a Laravel project. Check .env file Let’s start with the first and the most obvious one. Open the...
Let’s look at how we can get the raw SQL query from an Eloquent Model and Query Builder in just a few steps. Get raw SQL query from an Eloquent Model Here we...
Let’s have a look at how to run a JS file inside VS Code. To run a JS file inside VS Code first you have to make sure you have NodeJS installed....
Let’s have a look at how to convert file size to MB in JavaScript. Convert file size to MB in JS To convert file size to MB in JS, we can divide...
Let’s have a look at several ways you can check and get the Laravel version your app is using. Check Laravel version via CLI Check Laravel version via PHP Using Application::VERSION is faster because...