<?php
/**
 * Laravel-like Eloquent Model Base Class
 *
 * @package Licenzo\Framework\Database
 */

namespace Licenzo\Framework\Database;

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}

/**
 * Abstract Model Base Class
 */
abstract class Model extends Eloquent\Model
{
    public function getPerPage()
    {
        $request = \Licenzo\Framework\Http\Request::capture();

        if($request->has('per_page')) {
            return (int) $request->get('per_page');
        }

        return $this->perPage ?? 15;
    }
}
