PHP | Laravel | Web Scraping
A curated list of amazingly awesome PHP libraries, resources and shiny things.
| <?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 | |
| /** | |
| * | |
| * @author Saeedvir [ | |
| * 'email' => '[email protected]', | |
| * 'telegram' => 'https://t.me/PhpWebDeveloper' | |
| * ] | |
| * @usage : | |
| $dataGenerator = new DataStructureGenerator('data', true,true); | |
| $dataGenerator->setData('users', 8); |
| <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> |
| //in the head | |
| <x-session-timeout-alert-head :permanent="false" /> | |
| </head> | |
| //after livewire scripts | |
| @livewireScripts | |
| <x-session-timeout-alert-after-livewire-scripts /> | |
| </body> |
| <?php | |
| namespace App\Providers; | |
| use Illuminate\Support\Facades\Blade; | |
| use Illuminate\Support\ServiceProvider; | |
| class AppServiceProvider extends ServiceProvider | |
| { | |
| /** |
| <?php | |
| $spaces = [ | |
| 'driver' => 's3', | |
| 'key' => env('DO_SPACES_KEY'), | |
| 'secret' => env('DO_SPACES_SECRET'), | |
| 'endpoint' => env('DO_SPACES_ENDPOINT'), | |
| 'region' => env('DO_SPACES_REGION'), | |
| 'bucket' => env('DO_SPACES_BUCKET') | |
| ]; |