File tree Expand file tree Collapse file tree 2 files changed +75
-0
lines changed Expand file tree Collapse file tree 2 files changed +75
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace App \Models ;
4+
5+ use Illuminate \Database \Eloquent \Factories \HasFactory ;
6+ use Illuminate \Foundation \Auth \User as Authenticatable ;
7+ use Illuminate \Notifications \Notifiable ;
8+
9+ class Site extends Authenticatable
10+ {
11+ protected $ fillable = [
12+ 'url ' ,
13+ 'key ' ,
14+ 'php_version ' ,
15+ 'db_type ' ,
16+ 'db_version ' ,
17+ 'cms_version ' ,
18+ 'server_os ' ,
19+ 'update_patch ' ,
20+ 'update_minor ' ,
21+ 'update_major '
22+ ];
23+
24+ protected $ hidden = [
25+ 'key '
26+ ];
27+
28+ protected function casts (): array
29+ {
30+ return [
31+ 'last_seen ' => 'datetime ' ,
32+ 'update_patch ' => 'bool ' ,
33+ 'update_minor ' => 'bool ' ,
34+ 'update_major ' => 'bool '
35+ ];
36+ }
37+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Illuminate \Database \Migrations \Migration ;
4+ use Illuminate \Database \Schema \Blueprint ;
5+ use Illuminate \Support \Facades \Schema ;
6+
7+ return new class extends Migration
8+ {
9+ /**
10+ * Run the migrations.
11+ */
12+ public function up (): void
13+ {
14+ Schema::create ('sites ' , function (Blueprint $ table ) {
15+ $ table ->id ();
16+ $ table ->string ('url ' )->index ();
17+ $ table ->string ('key ' );
18+ $ table ->string ('php_version ' );
19+ $ table ->string ('ddb_type ' );
20+ $ table ->string ('db_version ' );
21+ $ table ->string ('cms_version ' )->index ();
22+ $ table ->string ('server_os ' );
23+ $ table ->boolean ('update_patch ' );
24+ $ table ->boolean ('update_minor ' );
25+ $ table ->boolean ('update_major ' );
26+ $ table ->dateTime ('last_seen ' );
27+ $ table ->timestamps ();
28+ });
29+ }
30+
31+ /**
32+ * Reverse the migrations.
33+ */
34+ public function down (): void
35+ {
36+ Schema::drop ('sites ' );
37+ }
38+ };
You can’t perform that action at this time.
0 commit comments