Skip to content

Commit

Permalink
Make user sessions compatible with Jetstream
Browse files Browse the repository at this point in the history
Remove pre-commit and app service config because they arent core requirements
Update docker-compose tag so we dont conflict with published tags
Fix npm build and vue-tsc bailing
Try to fix ziggy TS types (unsuccessfully)
  • Loading branch information
mosen committed Dec 11, 2023
1 parent c84cc30 commit 9d06e47
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 36 deletions.
27 changes: 0 additions & 27 deletions .pre-commit-config.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions appsvc.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

/**
* Adjust the users table we already have to align with Laravel Jetstream 3.x
*/
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->foreignId('current_team_id')->nullable();
$table->string('profile_photo_path', 2048)->nullable();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn([
'profile_photo_path',
'current_team_id',
]);
});
}
};
35 changes: 35 additions & 0 deletions database/migrations/2023_10_02_104816_create_sessions_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sessions');
}
};
2 changes: 1 addition & 1 deletion docker-compose.wip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
build:
context: ./
dockerfile: Dockerfile
image: ghcr.io/munkireport/munkireport-php:wip
image: munkireport-php:wip
restart: always
environment:
- MODULES=applications, directory_service, disk_report, displays_info, extensions, filevault_status, homebrew, homebrew_info, ibridge, installhistory, inventory, localadmin, managedinstalls, mdm_status, munkiinfo, munkireport, munkireportinfo, network, power, printer, profile, security, softwareupdate, sophos, supported_os, timemachine, usage_stats, user_sessions, warranty, wifi
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"private": true,
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"build": "npm run type-check && vite build",
"type-check": "vue-tsc --noEmit",
"preview": "vite preview",
"codegen": "graphql-codegen"
},
Expand Down
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"vite/client"
],
"paths": {
"@/": ["./resources/js/*"]
"@/": ["./resources/js/*"],
"ziggy-js": ["./vendor/tightenco/ziggy"]
},
"outDir": "./public/build/assets"
},
Expand All @@ -31,6 +32,7 @@
],
"exclude": [
"node_modules",
"public"
"public",
"vendor"
]
}

0 comments on commit 9d06e47

Please sign in to comment.