master

laravel/framework

Last updated at: 29/12/2023 09:22

Pivot.php

TLDR

This file defines a class called Pivot in the Illuminate\Database\Eloquent\Relations namespace. The Pivot class extends the Model class and uses the AsPivot trait. It has a public property $incrementing and a protected property $guarded.

Classes

Pivot

The Pivot class is a model class that represents the pivot table in a many-to-many relationship. It extends the Model class and uses the AsPivot trait. The Pivot class has the following properties:

  • $incrementing (bool): Indicates if the IDs are auto-incrementing.
  • $guarded (array): The attributes that aren't mass assignable.
<?php

namespace Illuminate\Database\Eloquent\Relations;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\Concerns\AsPivot;

class Pivot extends Model
{
    use AsPivot;

    /**
     * Indicates if the IDs are auto-incrementing.
     *
     * @var bool
     */
    public $incrementing = false;

    /**
     * The attributes that aren't mass assignable.
     *
     * @var array
     */
    protected $guarded = [];
}