Shilpa Kalangutkar has Published 53 Articles

How to use Validations in Laravel?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 29-Aug-2022 09:24:48

270 Views

It is important to validate the data that comes from the HTML forms. Laravel provides you with the validate() method using which you can define the rules on the input fields the way you want. The following examples show the working of validate() and how to make use of it ... Read More

How to get the server IP with Laravel?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 29-Aug-2022 09:00:15

5K+ Views

The server IP will be the IP address of the server you are connected to. When you are working with Laravel to get the server IP you can make use of $_SERVER['SERVER_ADDR']. The $_SERVER variable acts as a global variable in PHP. It holds details like header information, script location, ... Read More

How to check if a Laravel collection is empty?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 29-Aug-2022 08:52:14

17K+ Views

Before we answer the above question, let us first understand what collections are in Laravel. Collection in Laravel is an API wrapper that helps you deal with different operations to be performed on arrays. It makes use of the class Illuminate\Support\Collection to deal with arrays in Laravel. To create a collection ... Read More

Advertisements