Skip to content

Instantly share code, notes, and snippets.

View bhaidar's full-sized avatar

Bilal Haidar bhaidar

View GitHub Profile
Here is a quick way to add authentication logging to Laravel.
1. Modify app/Providers/EventServiceProvider.php and add lines 16 through 32 of the example file in this GIST.
2. Create a new file app/Listeners/LogActivity.php and copy the contents of the file below into that file.
3. Enjoy logging.
@bhaidar
bhaidar / google-recaptcha.md
Created December 15, 2023 20:30 — forked from babacarcissedia/google-recaptcha.md
Add google recaptcha to website

Opinionated code Laravel code for adding recaptcha on website. Bot protection especially on open form with user authentication.

  1. Create blade component for ease of reuse
resources/views/components/input/captcha.blade.php

@props([
    'id',
    'name',
@bhaidar
bhaidar / .eslintrc.js
Created December 5, 2023 15:35 — forked from onlime/.eslintrc.js
ESLint/Prettier config for Vue 3 in VS Code
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'prettier'
@bhaidar
bhaidar / print.css
Created October 26, 2023 19:04 — forked from anonymous/print.css
/**
* Print Stylesheet fuer Deinewebsite.de
* @version 1.0
* @lastmodified 16.06.2016
*/
@media print {
/* Inhaltsbreite setzen, Floats und Margins aufheben */
/* Achtung: Die Klassen und IDs variieren von Theme zu Theme. Hier also eigene Klassen setzen */

Learning Plan for Test Driven Development (TDD)

These learning resources primarily focus on Test Driven Development (TDD).

  • There is an emphasis on learning using PHP, Laravel and PHPUnit.
  • All these resources are free (at the time of writing)
@bhaidar
bhaidar / README.md
Created March 5, 2023 20:44 — forked from eusonlito/README.md
Laravel Auth and Session without database. Using a remote API as Auth and Data provider.

This is an example of a web that uses a remote API as a database wrapper.

The remote API is stateless and the web uses cookies to maintain session persistence.

The API authentication endpoint returns a TOKEN that allows the web to make each request to the API with the user authentication header.


Este es un ejemplo de web que usa una API remota como wrapper de base de datos.

@bhaidar
bhaidar / helpers.php
Created February 19, 2023 20:56 — forked from JordanDalton/helpers.php
Pipeline Helper / Wrapper
<?php
if( ! function_exists('pipe')) {
function pipe($payload, $steps = [])
{
return app(\Illuminate\Pipeline\Pipeline::class)
->send($payload)
->through($steps)
@bhaidar
bhaidar / FilesystemMockProvider.php
Created February 19, 2023 19:42 — forked from stevebauman/FilesystemMockProvider.php
Filesystem Cloud Mocking
<?php
namespace App\Providers;
class FilesystemMockProvider extends ServiceProvider
{
public function boot()
{
if (App::isProduction()) {
return;
@bhaidar
bhaidar / GoogleDriveServiceProvider.php
Created January 29, 2023 22:38 — forked from sergomet/GoogleDriveServiceProvider.php
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.