Saturday, July 27

Explain Laravel schema ?

 

The Laravel schema explained

The Laravel schema is used because it provides database agnostic support for creating and manipulating tables across all the Laravel supported database systems. It has a unified API across all these systems. Various manipulations are done in a database table like- creating and dropping tables, adding columns, changing columns, renaming columns, dropping columns, checking existence, adding indexes, etc. A schema is basically a representation of a plan or theory in the form of an outline or a model. In Laravel technology, your tables are exported as a Laravel schema to be used in migrations.

For example, the syntax for creating a new database table is given below-

Schema:: create function is used to create a new table in Laravel 5

Schema::create (‘users’, function ($table)
{
	$table-> increments (‘id’);
});

 

 

Source: laravelinterviewquestions.com

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x