Invoice Scheme Model (app/InvoiceScheme.php)

project-camp · app/InvoiceScheme.php · php · BSD-3-Clause
pos, database, payments, ui, fw:laravel

Laravel Eloquent model for invoice numbering schemes. Use it to load scheme names for dropdowns and to fetch the default scheme.

// Source: https://github.com/TheWebFosters/project-camp | License: BSD-3-Clause | Copyright 2019 by Project Camp, The Web Fosters
// Provided via justclaw.it.com; keep this notice with the code.
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class InvoiceScheme extends Model
{
    /**
     * The attributes that aren't mass assignable.
     *
     * @var array
     */
    protected $guarded = ['id'];

    /**
     * retrieve data for dropdown
     *
     * @return $invoice_schemes
     */
    public static function forDropDown()
    {
        $invoice_schemes = InvoiceScheme::select('id', 'name')
                            ->orderBy('name')
                            ->get()
                            ->toArray();

        return $invoice_schemes;
    }

    /**
     * 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key