Category: Laravel

Download file from storage in Laravel

In this article we are going to discuss how you can view or download files from the storage. If you want to upload some files to storage you can view this tutorial Routes You can add the following code to your routes\web.php file

Action in controller You have the getFile action in your UploadController. […]

Read more

The page has expired due to inactivity. Please refresh and try again. In Laravel

If you are getting following error when you submit the form The page has expired due to inactivity.Please refresh and try again. You can add csrf_field filed inside your form {{ csrf_field() }}

Read more

How to upload file in Laravel

We will see how to upload file in Laravel in this tutorial. First I am going to create fresh laravel project First you can download the composer and install it Next you can download the Laravel y running the following command in your terminal

Now you can create your Laravel project named fileupload

[…]

Read more

Simple REST API with Laravel

First you can create the model with the resorce controller

Now you can migrate the database file

Now you can create the API Resouce for the Product

This will create the ProductResource.php file at App\Http\Resources\Product

Read more

How to make two-factor authentication in Laravel

In this tutorial you can learn how to implement two-factor authentication in Laravel. You can follow the step by step guide to implement it What is two-factor authentication? Two-factor authentication is a mechanism to provide additional security to your login system. In addition to username and password you have to provide the token which will […]

Read more

How to add custom fields to registration form in Laravel

In this tutorial, you can study how to add custom field to Laravel. First you have to install Laravel in your computer and then install the Auth You can follow the steps given below to add custom field to registration post Create new Laravel project Download the Laravel via composer

Create new Laravel project […]

Read more

Sending SMS with Nexmo in Laravel

In this tutorial I am going to discuss how to send SMS using Nexmo. First you have to sign up in Nexmo website and you can use your free account for testing Then you can install the PHP client library using Composer

You can add Nexmo\Laravel\NexmoServiceProvider to the providers array in your config/app.php

[…]

Read more

Stripe Payment Integration with Laravel

In this tutorial we will see how to integrate Stripe payment system with Laravel 1 Create the shopping cart 2 Create the checkout page with payment form and get token 3 Charging the customer Create the shopping cart I am going to create the shopping cart now and add some product to it. I will […]

Read more

Middleware in Laravel

What is middleware in Laravel? It is a mechanism to filter the HTTP request coming to your web application. For example you can use the middleware to authenticate user of the application. So you can check the request coming from the user has authentication to see the web page in your server before it is […]

Read more

Creating Model

You can create Model in Laravel using the following artisan command

Above code will create a model named “POST” with migration file You can see the migration file created at database\migrations folder I have edited the file to introduce name and text fields to Post model

Now you can run the migrate

[…]

Read more