Understanding facades:
Common Facades
Cache::get('key');
DB::table('users')->get();
Route::get('/', fn() => view('home'));
Log::info('Message');Real-Time Facade
use Facades\App\Services\PaymentService;
PaymentService::process($order);Create Custom Facade
class Cart extends Facade
{
protected static function getFacadeAccessor()
{
return 'cart';
}
}Testing with Facades
Cache::shouldReceive('get')
->once()
->with('key')
->andReturn('value');