Skip to content

Instantly share code, notes, and snippets.

@cosmeoes
cosmeoes / GetUnionCatalogData.php
Created September 22, 2023 22:20
Union's open AI
<?php
namespace App\Console\Commands\OneTime;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use OpenAI;
class GetUnionCatalogData extends Command
{
"registered":{
"percent":100,
"count":1135
},
"active":{
"percent":79.65,
"count":904
},
"inactive":{
@cosmeoes
cosmeoes / ebtb-toc.md
Created May 16, 2023 01:18
Eloquent Beyond The Basics Table of Contents
  • The Laravel Query Builder
    • How does it work?
      • Bindings
    • Raw queries
    • Subqueries
      • Aggregates
  • Eloquent
    • What's an ORM?
    • What's the relationship between Eloquent and the query builder?
  • Where is the where?
@cosmeoes
cosmeoes / cache.php
Created March 22, 2022 15:18
Cache cheat sheet
// Store item for the given seconds
Cache::put('key', 'value', $seconds);
// Store item indefinitely
Cache::put('key', 'value');
// You can also use a DateTime instance
Cache::put('key', 'value', now()->addMinutes(10));
// Store if not present
Cache::add('key', 'value', $seconds);
// Store items forever
Cache::forever('key', 'value');