mgsmus Hocam laravel surumu 8.50.0.
dd() ile verileri aliyorum order_id geliyor yani normal. ilave hic bir islem yapmadim.
Schema::create('orders', function (Blueprint $table) {
$table->id();
$table->unsignedSmallInteger('coupon_id')->nullable();
$table->unsignedMediumInteger('customer_id');
$table->float('price',8,2,true);
$table->unsignedSmallInteger('money_type_id');
$table->timestamps();
}); buda orders tablosu
class Order extends Model
{
use HasFactory;
protected $fillable = [
'coupon_id' ,
'customer_id',
'price',
'money_type_id'
];
protected $dates = [
'created_at',
'updated_at'
];
public function coupon()
{
return $this->belongsTo(Coupon::class);
}
public function detail()
{
return $this->hasMany(OrderDetail::class);
} --modelide su sekilde