create history for webservice
This commit is contained in:
23
database/factories/PanjarehVahedHistoryFactory.php
Normal file
23
database/factories/PanjarehVahedHistoryFactory.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\PanjarehVahedHistory>
|
||||
*/
|
||||
class PanjarehVahedHistoryFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,6 @@ return new class extends Migration
|
||||
{
|
||||
Schema::table('harims', function (Blueprint $table) {
|
||||
$table->longText('data')->nullable();
|
||||
$table->string('token', 255)->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,7 +22,7 @@ return new class extends Migration
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('harims', function (Blueprint $table) {
|
||||
$table->dropColumn(['data', 'token']);
|
||||
$table->dropColumn('data');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
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::create('panjareh_vahed_histories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('harim_id')->constrained('harims');
|
||||
$table->longText('data');
|
||||
$table->tinyInteger('action')->default(0); // 0 => receive, 1 => send
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('panjareh_vahed_histories');
|
||||
}
|
||||
};
|
||||
17
database/seeders/PanjarehVahedHistorySeeder.php
Normal file
17
database/seeders/PanjarehVahedHistorySeeder.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PanjarehVahedHistorySeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user