Skip to content

Instantly share code, notes, and snippets.

View faisuc's full-sized avatar
🎯
Focusing

Neil Carlo Sucuangco faisuc

🎯
Focusing
View GitHub Profile
@MrPunyapal
MrPunyapal / LaravelWhereLikeMacro.php
Last active August 5, 2024 08:24
Laravel Custom 'whereLike' Macro for Dynamic 'LIKE' Searches including relationships
<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
@sawirricardo
sawirricardo / session-timezone.blade.php
Created August 4, 2023 03:56
Update timezone using Laravel Livewire Volt
<?php
$updateTimezone = fn($timezone) => session()->put('timezone', $timezone);
?>
<div x-init="$wire.updateTimezone(Intl.DateTimeFormat().resolvedOptions().timeZone)"></div>
@sagarkbhatt
sagarkbhatt / rest-controller-extend.php
Created May 11, 2017 09:16
Sample class that extends WP rest controller
<?php
/**
* Add rest api endpoint for category listing
*/
/**
* Class Category_List_Rest
*/
class Category_List_Rest extends WP_REST_Controller {
/**
@IftekherSunny
IftekherSunny / SubscribersTest.php
Last active February 2, 2022 11:29
Laravel File Upload API Test
<?php
use Illuminate\Http\UploadedFile;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class SubscribersTest extends TestCase
{
use DatabaseMigrations, WithoutMiddleware;
@abegit
abegit / wc_order_status_changes.php
Created February 2, 2016 20:11
WooCommerce Hooks for Order Status Changes
function mysite_pending($order_id) {
error_log("$order_id set to PENDING", 0);
}
function mysite_failed($order_id) {
error_log("$order_id set to FAILED", 0);
}
function mysite_hold($order_id) {
error_log("$order_id set to ON HOLD", 0);
}
function mysite_processing($order_id) {
@DragonBe
DragonBe / Product.php
Created March 28, 2014 13:21
Example usage for ArrayAccess interface
<?php
class Product implements ArrayAccess
{
protected $_productId;
protected $_title;
protected $_price;
protected $_arrayAccess;
public function __construct($data = null)
@msurguy
msurguy / List.md
Last active November 17, 2024 16:29
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):