One To One Relationship in Laravel

What is One To One relationships and usage of hasOne() and belongsTo() ? One to one relationships are very straightforward in Laravel. Make sure that one of the tables has a key that references the id of the other table. For example, an ‘address’ table will have a field called user_id . That will reference the users_id field. A one-to-one relationship exists when each row in one table has only one related row in a second table. For example, a business might decide

Read more

Simple view of add file into git repository

How to add File in Git repositery or import project into Git ? Install Git, use git-bash and goto git directory into git-bash by: $ cd c:/git Now open ‘Git-hub’ in browser or software and just create a ‘new’ repository by clicking create repository with new repository name. you can add readme file. This ‘repository folder’ is to be showing on git directory. github/login Now open git-base and enter the two commands one by on: Now copy the path of

Read more

Eloquent ORM Model for Database in Laravel

What is Laravel eloquent ORM ? Laravel includes Eloquent, an object-relational mapper (ORM) that makes it enjoyable to interact with your database. In addition to retrieving records from the database table, Eloquent models allow you to insert, update, and delete records from the table as well. The Eloquent ORM included with Laravel provides a simple Active Record implementation for working with your database. Each database table has a corresponding “Model” which is used to interact with that table. Before getting started, be sure

Read more

Create Laravel Migration table into a Database

1. What are Migrations and Migration table in Laravel? Laravel Migration is an essential feature in Laravel that allows you to “easily create a table in your database“. It allows you to create and modify the application’s database schema. You can modify the table by adding a new column or deleting an existing column. Migrations are like version control for your database. Migration tables are files that are created by an administrator. 2. Why do we use migrations? Another common reason for migration

Read more

Introduction to ‘CRUD’ Operation in Laravel

What is CRUD and its purpose ? The full form meaning of CRUD is “Create” “Retrieve” “Update” and “Delete“. In computer programming, create, read, update, and delete (CRUD) are the four basic operations of persistent storage. CRUD is also sometimes used to describe user interface conventions that facilitate viewing, searching, and changing information using computer-based forms and reports. CRUD operations are basic data manipulation for database. The ability to create, read, update and delete items in a web application is crucial to

Read more

Using of Variable, Keys and Tuples

What is variable in programming languages? In computer programming, a variable is a storage location (identified by a memory address) paired with an associated symbolic name. It contains some known or unknown quantity of information referred to as a value. Finally A variable is a container for a particular type of data (like integer, float, String etc). example: Java:: int num, String name; Php:: $num (there is not necessary for type) Kotlin:: var num, val num2; What is keys using in

Read more

Manual indexing of an Array in Php!

What is Array’s Manual indexing? when we create our own indexing in an array is known manual indexing. in which we change default indexing starting from zero ‘0’ index. we can keep values in our own indexing using “=>“this operator. for example. Syntax “index => values“, separated by commas, define index and values. Index may be of type string or integer. When index is omitted, an integer index is automatically generated, starting at 0. If index is an integer, next

Read more

Using String interpolation in php

String interpolation is quick shortcut, allowing to pop up the value of a variable into double quoted String. Remember that any variable with “$” sign into single quote is not a variable, it just treat as a statement. eg. ‘$num is not a variable’ because num variable is written into single quote.

Read more

How to run Php First program in Xampp server.

Step 1: First install to xampp server by official link https://www.apachefriends.org/download.html, after that you need to open server to start Apache server. And also start mysql for phpadmin. Step 2: Now open any browser in your pc and just type this url: http://localhost and then server run for interprete any php code. Step 3: Now create the project file and copy it’s directory and paste into the browser like: http://localhost/myphp/first.php before you create just a folder into c:\xampp\htdocs\myphp Step 4:

Read more