Skip to content

Instantly share code, notes, and snippets.

View elishaukpong's full-sized avatar
🇳🇬
Learning something new somewhere!

Elisha Ukpong elishaukpong

🇳🇬
Learning something new somewhere!
View GitHub Profile
<?php
class Node {
private $data;
private $next = null;
/**
* @param $data
*/
@elishaukpong
elishaukpong / pipeline.php
Last active January 24, 2023 23:52
Gist showing a basic overview of pipelines
<?php
use Illuminate\Pipeline\Pipeline;
$content = 'anything';
$pipes = [
pipe1, pipe2, pipe3,...pipe(n)
];
@elishaukpong
elishaukpong / pipeline.php
Created January 24, 2023 23:44
Gist showing a basic overview of pipelines
<?php
app(Pipeline::class)
->send($content)
->through($pipes)
->via(‘customMethodName’) // <---- This one :)
->then(function ($content) {
return Post::create(['content' => $content]);
});
<?php
...
/**
* Handle dynamic, static calls to the object.
*
* @param string $method
* @param array $args
* @return mixed
class Party
{
public static function __callStatic($method, $args)
{
// graceful handling
}
}
<?php
/** CONCRETE CLASS DECLARATIONS **/
use App\Services;
class Greetings
{
public const FACADE_ACCESSOR = "greetings";
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
{{--removed some content here--}}
</head>
<body class="antialiased">
<div class="relative flex items-top justify-center min-h-screen bg-gray-100 dark:bg-gray-900 sm:items-center py-4 sm:pt-0">
@if (Route::has('login'))
<div class="hidden fixed top-0 right-0 px-6 py-4 sm:block">
@auth
<?php
use App\Facades\Compliment;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
<?php
namespace App\Providers;
use App\Services\Compliment;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
@elishaukpong
elishaukpong / Compliment.php
Last active January 2, 2023 11:33
Compliment Facade
<?php
namespace App\Facades;
use \Illuminate\Support\Facades\Facade;
class Compliment extends Facade
{
/**
* Get the registered name of the component.