Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Shilpa Kalangutkar
45 articles
Remote File Synchronization in Linux
Remote Synchronization (rsync) is a powerful command-line utility in Linux that efficiently synchronizes files and directories between two locations, whether locally on the same machine or remotely between different systems. It is widely used by system administrators for copying, syncing, backup, and mirroring data. The rsync command operates by designating one machine as the source and another as the destination. What makes rsync particularly efficient is its delta transfer algorithm, which compares files and transfers only the differences between source and destination after the initial full transfer. Features Delta Transfer Algorithm − Only transfers file differences, ...
Read MoreFind and Delete Files and Directories on Linux
In this article we are going to understand the find command in Linux and how to use it to delete files and directories effectively. The find Command The find command in Linux is a powerful command-line utility that helps you search for files and directories based on specified criteria and perform operations on the results. It can search by name, type, permissions, modification time, and other attributes. The search starts from a specified location and traverses recursively through all subdirectories in the hierarchy. You can limit the search scope by specifying particular directories or using various filtering ...
Read MoreHow to make Laravel (Blade) text field read-only?
In Laravel Blade templates, you can make text fields read-only using Laravel's Form facade or plain HTML input elements. This prevents users from editing the field while still displaying the value. Installation: For Laravel Form facade, install the package: composer require laravelcollective/html Setting up Routes and Views First, let's create a basic route that passes data to our Blade template − Create hello.blade.php in the resources/views/ folder − {{ $mymsg }} Welcome to Tutorialspoint Using Laravel Form Facade The Form facade provides ...
Read MoreHow to remove a parameter from all Request Objects at Controller Level in Laravel?
In Laravel, you can remove specific parameters from Request objects in your controller using several methods. This is useful for filtering unwanted data before processing or validation. Using unset() Method The simplest approach is using PHP's built−in unset() function to remove parameters directly from the request object ? Array ( [_token] => nUXVJ5adsFLADKC9RCbAJcdfYCRquy8GUkUCXtR8 [name] => Rasika Desai [email] => rasika@gmail.com [age] => 20 [address] => Pune ) Array ( [_token] => nUXVJ5adsFLADKC9RCbAJcdfYCRquy8GUkUCXtR8 ...
Read MoreHow to validate aninput field if the value is not NULL in Laravel?
In Laravel, you can validate input fields to ensure they are not NULL using the Validation class. The required rule is the most common way to validate that a field is not null or empty. Basic Validation Syntax The Validator::make() method takes two arguments − the data to validate and the validation rules ? In this example, the name field is required and must have at least 5 characters. Complete Validation Example Here's a complete controller example that validates multiple fields for non-null values ? ...
Read MoreHow to validate exact words in Laravel?
Laravel provides several methods to validate exact words in your application. The most common approaches include using Rule::in method, in: validation rule, and regular expressions for precise word matching. Using Rule::in Method The Rule::in method validates that the field value matches one of the specified values exactly. To use this method, you need to import the Rule class ? Make sure to include: use Illuminate\Validation\Rule; at the top of your file. Here the input array has category values ABC and XYZ, but Rule::in expects ABC and TIK. Since XYZ doesn't ...
Read MoreHow to validate Route Parameters in Laravel?
In Laravel, route parameter validation ensures that URLs match specific patterns before executing route handlers. Laravel provides several built−in methods to validate route parameters, making your application more secure and predictable. Route Parameters Syntax Route parameters are defined within curly braces and can contain alphanumeric characters and underscores ? Multiple Route Parameters You can define multiple parameters in a single route ? Optional Parameters Optional parameters are denoted with ? and require default values ? Using where() Method The where() ...
Read MoreHow to pass a CSRF token with an Ajax request in Laravel?
CSRF stands for Cross-Site Request Forgeries. CSRF is a malicious activity performed by unauthorized users acting to be authorized. Laravel protects such malicious activity by generating a csrf token for each active user session that must be included with Ajax requests. Generating CSRF Token You can get the token in two ways − By using $request→session()→token() By using the csrf_token() method directly Example Output The output for above is − 13K625e8mnDna1oxm9rqjfAPfugtTlYdndBoNR4d 13K625e8mnDna1oxm9rqjfAPfugtTlYdndBoNR4d CSRF Token in Blade Template Inside blade template you can make ...
Read MoreHow to compare two encrypted (bcrypt) passwords in Laravel?
In Laravel, you can use the Hash facade to securely work with passwords using bcrypt encryption. The Hash facade provides methods to hash passwords and verify plain text against hashed passwords. Note: This tutorial requires Laravel framework setup. Install Laravel using composer create-project laravel/laravel myapp and configure your environment. Hash Facade Setup To work with the Hash facade, import it in your controller − use Illuminate\Support\Facades\Hash; The hashing configuration is available in config/hashing.php where bcrypt is set as the default driver. Hashing Passwords Use the make() method to hash ...
Read MoreHow to define a route differently if a parameter is not an integer?
In Laravel routing, you can validate route parameters to ensure they meet specific criteria, such as ensuring a parameter is not an integer. This is accomplished using Laravel's built-in route parameter validation methods. Basic Route Parameters Route parameters are defined within curly braces and can contain alphanumeric characters and underscores ? Route::get('/user/{myid}', function ($myid) { // }); You can also define multiple parameters in a single route ? Route::get('/students/{post}/feedbacks/{feedback}', function ($postId, $feedbackId) { // }); Using where() Method The where() method ...
Read More