Skip to content

Instantly share code, notes, and snippets.

@zuxbrt
zuxbrt / Search.php
Last active January 26, 2022 13:05
Laravel eloquent search helper class with pagination
<?php
// composer json
// "php": "^7.3|^8.0",
// "laravel/framework": "^8.75"
class Search
{
public $model;
@zuxbrt
zuxbrt / Pagination.php
Last active January 26, 2022 13:04
Laravel Pagination helper class
<?php
// composer json
// "php": "^7.3|^8.0",
// "laravel/framework": "^8.75"
namespace App\Helpers;
class Pagination
{
@zuxbrt
zuxbrt / Service.php
Last active November 6, 2020 08:13
Laravel blade partial for checkbox group with inputs.
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Service extends Model
{
protected $table = 'vehicles';
<?php
session_start();
// before serving, make sure phpspreadsheet library is added to vendor
// --- composer require phpoffice/phpspreadsheet ---
// usage: php -S localhost:8000 excelexport.php
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
<?php
/**
* @author zuxbrt
*/
namespace App\Handlers;
use Exception;
class CSVEncoder