PHP | Laravel | Web Scraping
A curated list of amazingly awesome PHP libraries, resources and shiny things.
<?php | |
namespace App\Traits; | |
trait FullTextSearch | |
{ | |
/** | |
* Replaces spaces with full text search wildcards | |
* | |
* @param string $term |
<?php | |
use Illuminate\Database\Query\Builder; | |
/** | |
* Trait MatchableTrait | |
* Author : Gael Debost | |
* Add a very basic match method to an Eloquent Model. Based on a SQL MATCH | |
* You need FULL TEXT Indexes in order to match fields. Somes rules : |
PHP | Laravel | Web Scraping
A curated list of amazingly awesome PHP libraries, resources and shiny things.
<?php | |
namespace App\Eloquents\Traits; | |
use Illuminate\Database\Eloquent\Builder; | |
use Illuminate\Support\Str; | |
use ReflectionClass; | |
/** | |
* Generates prefixed column along with padded specific model attribute (e.g. model table primary key attribute) |
<?php | |
namespace App\Http\Resources; | |
use Illuminate\Http\Resources\Json\ResourceCollection; | |
use Illuminate\Pagination\UrlWindow; | |
use Illuminate\Support\Arr; | |
use Barryvdh\Debugbar\Facade as DebugbarFacade; | |
use Illuminate\Container\Container; | |
use Illuminate\Contracts\Pagination\LengthAwarePaginator as LengthAwarePaginatorContract; |
<?php | |
/** | |
* | |
* @author Saeedvir [ | |
* 'email' => '[email protected]', | |
* 'telegram' => 'https://t.me/PhpWebDeveloper' | |
* ] | |
* @usage : | |
$dataGenerator = new DataStructureGenerator('data', true,true); | |
$dataGenerator->setData('users', 8); |
<?php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Support\Facades\Cache; | |
use Illuminate\Support\Str; | |
use RecursiveArrayIterator; | |
use RecursiveIteratorIterator; |
<script data-turbolinks-eval=false> | |
function updateToken() { | |
fetch('/update-csrf') | |
.then(response => response.text()) | |
.then(csrf => { | |
document.head.querySelector('meta[name="csrf-token"]').setAttribute('content', csrf) | |
}) | |
} | |
setInterval(updateToken, 1000 * 60 * 5) | |
</script> |