How to Create and Load Model in Laravel

A model is a PHP class where perform data logic and database manipulation like – retrieve data, insert, update, and delete.

In Laravel models classes are stored in app/ directory.

This mainly loads from the controller.

In this tutorial, I show how you create and load Model in the controller and fetch records from MySQL database in Laravel.

How to create and load Model in Laravel

Read more

Check Username Availability with Vue.js and PHP

Live username availability checking on the registration page is the common feature on most websites.

This will notify the user whether the username is already been taken or not before submitting it.

To do this require AJAX.

Send a request to check the username on the basis of response to perform the action.

In this tutorial, I show how you can check username availability using Vue.js and PHP while inputting.

Check Username Availability with Vue.js and PHP

Read more

How to Load and pass data to View in Laravel

Laravel follows Model view controller pattern.

    • Controller – Interact with Model and view.
    • Model – Handles database manipulation.
    • View – Display final UI to the user from where it can interact with the application.

Laravel comes with Blade templating engine which makes easier to create pages. Blade view file compiled into plain PHP code.

Blade view files has .blade.php extension.

You can use PHP code in it.

I am assuming you have already created a Laravel project if not then you can view my earlier tutorial.

In this tutorial, I will create a simple application where pass data to view.

How to Load and pass data to View in Laravel

Read more