master

laravel/framework

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

Scope.php

TLDR

The provided file defines an interface called Scope in the Illuminate\Database\Eloquent namespace. This interface contains a single method called apply which should be implemented by any class that implements the Scope interface.

Methods

apply

This method is responsible for applying the scope to a given Eloquent query builder. It takes two parameters:

  • $builder: An instance of the Builder class from the Illuminate\Database\Eloquent namespace.
  • $model: An instance of the Model class from the Illuminate\Database\Eloquent namespace.

This method does not return a value.

Classes

N/A

<?php

namespace Illuminate\Database\Eloquent;

interface Scope
{
    /**
     * Apply the scope to a given Eloquent query builder.
     *
     * @param  \Illuminate\Database\Eloquent\Builder  $builder
     * @param  \Illuminate\Database\Eloquent\Model  $model
     * @return void
     */
    public function apply(Builder $builder, Model $model);
}