Category: Laravel

Laravel Test Driven Development

In following Youtube series you can learn the the TDD with Laravel Part 1 Introduction, PHPUnit Setup & Books Test Part 1 Part 2 Deleting a Record, Asserting Instance Of & Carbon Parse Part 3 Implementing a firstOrCreate Author Record With TDD Part 4 Book Checkout & Book Checkin Flow With TDD

Read more
Laravel API Request Validation

Laravel Api Request validation

Laravel Api Request validation to get 402 status code. You can use the following code when you validate your REST Api.

Read more

Vee Validate show errors by REST API server messages Laravel + Vue.js

In your Laravel + Vue Application, you have to do two validations to make error-free application 1 Client side validation 2 Server side validation We are using popular Vee Validate Vue.js package for the client-side validation. In this article, I am going to show you how you can do the server-side validation and show the […]

Read more

How to create model with resource-full controller

In Laravel, you can create Model with resorcefull controller easily by using the following command in your terminal If you want to create model with a controller you can use the followng command

If you want to create Resourefull controller you can use the following command

If you need to create model,controller and […]

Read more

Laravel Model Observer

What is Observer? In Laravel, you can listen to events on a Model. For example, when you update the model product, it will fire the event updated. You can listen to these events and write some code to executes when they fire. There are several events like creating, updating, deleting etc. So you can group […]

369 total views, no views today

Read more

JSON request to Laravel RESTFull API end point

If you want to send JSON request to Laravel RESTFull API end point, you can set he header as shown in the following image. We are using POSTman to show he example Set Accept to application/json With above request you can use the following code in your project

Read more

Beginning JWT in Laravel

Intsall the followoing package in your Laravel project First you can install the third-party JWT package by running the following command in your terminal

Open config/app.php and add the following provider to the providers array:

Use the following command to publish JWT provider

Now you can use following command to generate […]

Read more

Laravel and Vue.JS Installation

We will try to install the Laravel latest version which comes Vue.js 1 First thing you have to install the composer if you already have not installed in your computer 2 Next you can run following command in your terminal

This will download the composer file to install the Laravel project 3 Now you […]

Read more

Laravel get records with Order BY

In your Laravel application if you want to get some records according to date you entered you can use the Order By clause as shown in below

Here you are using order_date field to select records by descending order. I am using pagination method to get only the first 20 records

Read more

Laravel Resource Controller

How to Creare Resource Controller You can create the resource controller using following artisan command

This resource controller will have the CRUD methods as shown in the following table Verb URI Action Route Name GET /products index products.index GET /products/create create products.create POST /products store products.store GET /products/{product} show products.show GET /products/{product}/edit edit products.edit […]

Read more