Skip to content

Instantly share code, notes, and snippets.

@barryvdh
barryvdh / HttpClientEventsMiddleware.php
Created September 7, 2021 12:52
Middleware to log Guzzle requests with Telescope
<?php
namespace App\Http\Client;
use GuzzleHttp\Promise;
use Illuminate\Http\Client\Events\ConnectionFailed;
use Illuminate\Http\Client\Events\RequestSending;
use Illuminate\Http\Client\Events\ResponseReceived;
use Illuminate\Http\Client\Request;
use Illuminate\Http\Client\Response;
@Robiussani152
Robiussani152 / delete-hidden-files.php
Created October 22, 2020 06:14
Ftp related important files.
<?php
/**
* Find and delete all hidden files in $dir
* Usage: remove-hidden-files.php OR remove-hidden-files.php /path/to/parse/
*
* Without path parameter, the current path is being used.
*
* (C)ommitted 2015 by @author Fabian Wolf (@link http://usability-idealist.de/)
*
* @license GNU GPL v3
@saqueib
saqueib / SimplePagination.vue
Last active December 23, 2020 03:52
VueJS pagination component to paginate anything in Laravel, checkout the tutorial on http://wp.me/p8cmxL-b7 by www.qcode.in
<template>
<div :class="{'loading': loading}" class="pager-data-wrapper">
<!-- Pagination Slot -->
<slot :result="getResult()">
<div class="text-center alert-info pb-3">
<span v-if="!loading">
{{ result.length }} items found. render it using v-for="item in result"
</span>
<span v-if="loading">
@andyg1
andyg1 / DatabaseSeeder.php
Created November 20, 2015 11:05
Truncating Laravel tables before seeding them
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DatabaseSeeder extends Seeder
{
protected $toTruncate = ['users'];
public function run()