First, Introduction:
A Laravel 5.3 form implementation Curd Quick Start tutorial (Demo)
Code Download: Https://github.com/yanlongma/laravel-curd
Second, installation:
1. Connecting to the database
Modify the. env configuration file
Db_connection=mysql
Db_host=localhost
db_port=3306
Db_database=laravel
Db_username=root
Db_password=root
2. New data table
First create a database laravel, and then create a datasheet.
2.1. Create a datasheet using laravel migration
PHP Artisan Migrate
2.2 Manually execute the following SQL create data table
DROP TABLE IF EXISTS students;
CREATE TABLE IF not EXISTS students (
' id ' INT auto_increment PRIMARY KEY,
' Name ' VARCHAR (255) Not NULL DEFAULT ' COMMENT ' name ',
' Age ' TINYINT UNSIGNED not NULL DEFAULT 0 COMMENT ' ages ',
' Sex ' TINYINT UNSIGNED not NULL DEFAULT COMMENT ' sex ',/* 10 unknown 20 Male 30 Female * *
' Created_at ' INT not NULL DEFAULT 0 COMMENT ' Add time ',
' Updated_at ' INT not NULL DEFAULT 0 COMMENT ' modify time '
) Engine=innodb DEFAULT charset=utf8 comment= ' student table ';
3. Visit
Open the browser, enter your project address, please confirm your address before visiting, as follows:
http://localhost:8888/laravel-curd/public/index.php
If the following page appears, the installation is successful, you can start Laravel learning journey!