1. Go to this page and download the library: Download tomatophp/filament-docs library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('documents', function (Blueprint $table) {
$table->foreignId('team_id')->nullable()->constrained('teams')->onDelete('cascade');
});
Schema::table('document_templates', function (Blueprint $table) {
$table->foreignId('team_id')->nullable()->constrained('teams')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('documents', function (Blueprint $table) {
$table->dropForeign(['team_id']);
$table->dropColumn('team_id');
});
Schema::table('document_templates', function (Blueprint $table) {
$table->dropForeign(['team_id']);
$table->dropColumn('team_id');
});
}
};