feat: implement currency rates tracking with models, migrations and views
هذا الالتزام موجود في:
34
database/migrations/2025_05_23_235710_create_rates_table.php
Normal file
34
database/migrations/2025_05_23_235710_create_rates_table.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use App\Models\City;
|
||||
use App\Models\Currency;
|
||||
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('rates', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(Currency::class);
|
||||
$table->foreignIdFor(City::class);
|
||||
$table->decimal('buy_price');
|
||||
$table->decimal('sell_price');
|
||||
$table->date('date');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('rates');
|
||||
}
|
||||
};
|
||||
المرجع في مشكلة جديدة
حظر مستخدم