Total Complexity | 2 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class m180824_090744_create_notification_table extends Migration |
||
|
|||
11 | { |
||
12 | public function up() |
||
13 | { |
||
14 | $this->createTable('notification', [ |
||
15 | 'id' => $this->primaryKey(), |
||
16 | 'level' => $this->string(), |
||
17 | 'notifiable_type' => $this->string(), |
||
18 | 'notifiable_id' => $this->integer()->unsigned(), |
||
19 | 'subject' => $this->string(), |
||
20 | 'body' => $this->text(), |
||
21 | 'read_at' => $this->timestamp()->null(), |
||
22 | 'created_at' => $this->timestamp()->defaultExpression('CURRENT_TIMESTAMP'), |
||
23 | 'updated_at' => $this->timestamp()->null(), |
||
24 | ]); |
||
25 | $this->createIndex('notifiable', 'notification', ['notifiable_type', 'notifiable_id']); |
||
26 | } |
||
27 | |||
28 | public function down() |
||
32 | } |
||
33 | |||
34 | } |
Classes in PHP are usually named in CamelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.
Thus the name database provider becomes
DatabaseProvider
.