Skip to content

Instantly share code, notes, and snippets.

@adrian-ortega
Created September 6, 2022 17:50
Show Gist options
  • Save adrian-ortega/f914338ad2f7a368187470b216aaa311 to your computer and use it in GitHub Desktop.
Save adrian-ortega/f914338ad2f7a368187470b216aaa311 to your computer and use it in GitHub Desktop.
General Laravel and Lumen Helpers
<?php
namespace App\Models;
use Closure;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model as BaseModel;
use Illuminate\Support\Carbon;
/**
* @mixin Builder
*
* @method static Builder|static query()
* @method static static make(array $attributes = [])
* @method static static create(array $attributes = [])
* @method static static forceCreate(array $attributes)
* @method User firstOrNew(array $attributes = [], array $values = [])
* @method User firstOrFail($columns = ['*'])
* @method User firstOrCreate(array $attributes, array $values = [])
* @method User firstOr($columns = ['*'], Closure $callback = null)
* @method User firstWhere($column, $operator = null, $value = null, $boolean = 'and')
* @method User updateOrCreate(array $attributes, array $values = [])
* @method null|static first($columns = ['*'])
* @method static static findOrFail($id, $columns = ['*'])
* @method static static findOrNew($id, $columns = ['*'])
* @method static null|static find($id, $columns = ['*'])
*
* @property-read int $id
*
* Timestamps
* @property-read Carbon $created_at
* @property-read Carbon $updated_at
* @property-read Carbon $deleted_at
*/
class Model extends BaseModel
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment