- The Laravel Query Builder
- How does it work?
- Bindings
- Raw queries
- Subqueries
- Aggregates
- How does it work?
- Eloquent
- What's an ORM?
- What's the relationship between Eloquent and the query builder?
- Where is the where?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands\OneTime; | |
use Exception; | |
use Illuminate\Console\Command; | |
use Illuminate\Support\Facades\Cache; | |
use OpenAI; | |
class GetUnionCatalogData extends Command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"registered":{ | |
"percent":100, | |
"count":1135 | |
}, | |
"active":{ | |
"percent":79.65, | |
"count":904 | |
}, | |
"inactive":{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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'); |