Shilpa Kalangutkar has Published 53 Articles

How to compare two encrypted (bcrypt) passwords in Laravel?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 30-Aug-2022 14:10:07

6K+ Views

In Laravel, you can make use of the Hash facade module to work with passwords. It has bcrypt for helping you store your passwords securely. The Hash facade bcrypt() method is a powerful way to hash a password. It prevents malicious users from breaking the password generated using bcrypt(). The ... Read More

How to define a route differently if a parameter is not an integer?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 30-Aug-2022 14:08:14

462 Views

The route parameters are available inside the curly braces and the name given has alphanumeric characters. Along with alphanumeric, you can also make use of underscore when choosing the name for your route params. Syntax The syntax for route parameters is as shown below − Route::get('/user/{myid}', function ($myid) { ... Read More

How to upload files in Laravel directly into the public folder?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 30-Aug-2022 14:05:08

24K+ Views

This is what we have in our public/ folder. Let us move the files uploaded inside images/ folders in public. The file upload display is as follows − The blade template for the above is as follows − Student Form ... Read More

How to insert raw data in MySQL database in Laravel?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 30-Aug-2022 13:58:54

5K+ Views

You can make use of the Query Builder tool to insert raw data in MySQL tables. You have to include the class: Illuminate\Support\Facades\DB; or use DB; Assume we have created a table named students using the CREATE statement as shown below − CREATE TABLE students( id ... Read More

What are Named Routes in Laravel?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 30-Aug-2022 13:56:04

2K+ Views

In Laravel routes are defined inside the routes/ folder. All the routes that are required inside your project are defined inside routes/web.php. Example 1 A simple example of defining route is as follows − Route::get('/', function () { return view('welcome'); }); So now when you hit ... Read More

How to call a controller function inside a view in Laravel 5?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 30-Aug-2022 13:50:20

4K+ Views

The controller method you want to use can be added inside the view as shown below – Here App\Http\Controllers\StudentController is the controller and test() is the method we want to call. Example 1 The view is student.blade.php.Here we are calling the controller studentController and the method test(). The ... Read More

How to get the contents of the HTTP Request body in Laravel?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 30-Aug-2022 13:28:45

10K+ Views

To get the details of the HTTP request you need to make use of the class Illuminate\Http\Request. With the above class, you will be able to fetch the input, cookies, and files from HTTP requests. Now consider the following form – To get all the details from the HTTP ... Read More

How to Insert a value to a hidden input in Laravel Blade?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 30-Aug-2022 13:27:24

4K+ Views

The blade is a template engine that helps you to build your view display in Laravel. It also helps you to use PHP code inside the template. The blade templates are saved as filename.blade.php and are stored inside the resources/views/ folder. To understand the above question let us create a ... Read More

How to change variables in the .env file dynamically in Laravel?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 30-Aug-2022 13:04:42

8K+ Views

The .env file has the following details − APP_NAME=Laravel APP_ENV=local APP_KEY=base64:BUdhVZjOEzjFihHKgt1Cc+gkQKPoA4iH98p5JwcuNho= APP_DEBUG=true APP_URL=http://localhost LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=test DB_USERNAME=root DB_PASSWORD= BROADCAST_DRIVER=log CACHE_DRIVER=file FILESYSTEM_DRIVER=public QUEUE_CONNECTION=sync SESSION_DRIVER=file SESSION_LIFETIME=120 MEMCACHED_HOST=127.0.0.1 REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 SERVER_ADDR = 127.0.0.1 MAIL_MAILER=smtp MAIL_HOST=mailhog MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS=null MAIL_FROM_NAME="${APP_NAME}" AWS_ACCESS_KEY_ID= ... Read More

How to decode JSON objects in Laravel and apply for each loop on that?

Shilpa Kalangutkar

Shilpa Kalangutkar

Updated on 30-Aug-2022 13:03:26

10K+ Views

The json_decode() method is a PHP built-in function, which helps to convert a JSON object into a PHP object. It takes the input value as a string and returns a readable PHP object Example 1 Following is an example of the json_decode() method − $studentobj = '{"Neha":35, "Arbaaz":37, "Rehan":43}'; ... Read More

Advertisements