Skip to content

Commit 2013024

Browse files
committed
User Device (#514)
1 parent acbac12 commit 2013024

18 files changed

+168
-13
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
}
1818
],
1919
"require": {
20+
"jenssegers/agent": "*",
2021
"moox/core": "*"
2122
},
2223
"autoload": {

config/user-device.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22

33
return [
44
'navigation_sort' => 2001,
5+
'user_models' => [
6+
'App Users' => \App\Models\User::class,
7+
'Moox Users' => \Moox\User\Models\User::class,
8+
],
59
];

database/geoip/GeoLite2-ASN.mmdb

8.08 MB
Binary file not shown.

database/geoip/GeoLite2-City.mmdb

51.7 MB
Binary file not shown.
6.16 MB
Binary file not shown.

database/migrations/create_user_devices_table.php.stub

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66
use Illuminate\Support\Str;
77

8-
class new class extends Migration
8+
return new class extends Migration
99
{
1010
public function up()
1111
{
1212
Schema::create('user_devices', function (Blueprint $table) {
1313
$table->id();
1414
$table->string('title');
1515
$table->string('slug')->unique();
16-
$table->morphs('user');
16+
$table->unsignedBigInteger('user_id');
17+
$table->string('user_type');
1718
$table->string('user_agent')->nullable();
1819
$table->string('os')->nullable();
1920
$table->string('browser')->nullable();
21+
$table->string('platform')->nullable();
2022
$table->string('country')->nullable();
21-
$table->string('location')->nullable();
23+
$table->string('city')->nullable();
24+
$table->json('location')->nullable();
2225
$table->boolean('whitelisted')->default(false);
2326
$table->boolean('active')->default(false);
2427
$table->ipAddress('ip_address')->nullable();
@@ -30,4 +33,4 @@ class new class extends Migration
3033
{
3134
Schema::dropIfExists('user_devices');
3235
}
33-
}
36+
};

resources/lang/de/translations.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
'title' => 'Device',
88
'navigation_label' => 'User Device',
99
'navigation_group' => 'Moox User',
10-
'title' => 'Title',
1110
'created_at' => 'Created at',
1211
'active' => 'active',
1312
];

resources/lang/en/translations.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
'title' => 'Device',
88
'navigation_label' => 'User Device',
99
'navigation_group' => 'Moox User',
10-
'title' => 'Title',
1110
'created_at' => 'Created at',
1211
'active' => 'active',
1312
];

resources/lang/es/translations.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
'title' => 'Device',
88
'navigation_label' => 'User Device',
99
'navigation_group' => 'Moox User',
10-
'title' => 'Title',
1110
'created_at' => 'Created at',
1211
'active' => 'active',
1312
];

resources/lang/hr/translations.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
'title' => 'Device',
88
'navigation_label' => 'User Device',
99
'navigation_group' => 'Moox User',
10-
'title' => 'Title',
1110
'created_at' => 'Created at',
1211
'active' => 'active',
1312
];

0 commit comments

Comments
 (0)