The brands and categories tables will each have an id and a name field.Ĭreate the brands table: CREATE TABLE `e_store `. The database will be named e_store and have three tables named brands, categories, and products respectively.Ĭreate the e_store database: CREATE DATABASE IF NOT EXISTS `e_store ` DEFAULT CHARACTER SET utf8ĭEFAULT COLLATE utf8_general_ci SET default_storage_engine = INNODB However, with the JSON data type, this use case can be approached differently. Traditionally, the Entity–attribute–value model (EAV) pattern would be used to allow customers to compare the features of products. Step 1 - Defining the Schemaįor the purposes of this tutorial, you will be building from a schema that defines the inventory of an online store that sells a variety of electronics. This tutorial was verified with MySQL v8.0.23, PHP v7.3.24, Composer v2.0.9, and Laravel v8.26.1. This may be an alternative option if you are having difficulty setting up your local environment. Note: Laravel now provides a tool called Sail to work with Docker that will configure an environment with MySQL, PHP, and Composer. You can consult our tutorial on installing Composer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |