mirror of
https://github.com/LeCoupa/awesome-cheatsheets.git
synced 2026-05-10 08:20:05 -07:00
Compare commits
5 Commits
9f1a38e095
...
14689f0dc5
| Author | SHA1 | Date | |
|---|---|---|---|
| 14689f0dc5 | |||
| 2aee46f169 | |||
| 22977d5ca1 | |||
| a2c99c9674 | |||
| d218fcf074 |
@@ -419,6 +419,8 @@ $table->dropSpatialIndex('geo_location_spatialindex'); // Drop a spatial index f
|
|||||||
// FOREIGN KEY CONSTRAINTS
|
// FOREIGN KEY CONSTRAINTS
|
||||||
|
|
||||||
$table->foreign('user_id')->references('id')->on('users'); // Create foreign key constraints.
|
$table->foreign('user_id')->references('id')->on('users'); // Create foreign key constraints.
|
||||||
|
$table->foreignId('user_id')->constrained('users'); // Create foreign key terser methods (7.x).
|
||||||
|
$table->foreignId('user_id')->constrained()->onUpdate('cascade')->onDelete('cascade'); // Specify the desired action for the "on delete" and "on update" properties of the constraint(7.x).
|
||||||
$table->dropForeign('posts_user_id_foreign'); // Drop foreign key (accepts an array of strings).
|
$table->dropForeign('posts_user_id_foreign'); // Drop foreign key (accepts an array of strings).
|
||||||
|
|
||||||
Schema::enableForeignKeyConstraints(); // Enable foreign key constraints within your migrations.
|
Schema::enableForeignKeyConstraints(); // Enable foreign key constraints within your migrations.
|
||||||
|
|||||||
+1
-1
@@ -286,7 +286,7 @@ for(dataType item : array) {
|
|||||||
|
|
||||||
### ACCESS MODIFIERS
|
### ACCESS MODIFIERS
|
||||||
|
|
||||||
1. defualt(No keyword required)
|
1. default(No keyword required)
|
||||||
2. private
|
2. private
|
||||||
3. public
|
3. public
|
||||||
4. protected
|
4. protected
|
||||||
|
|||||||
Reference in New Issue
Block a user