Skip to content

Instantly share code, notes, and snippets.

View Aslam97's full-sized avatar
🎯
Focusing

Aslam Aslam97

🎯
Focusing
  • Full-Stack Web Developer
  • Bandung, Jawa Barat, Indonesia
  • 16:33 (UTC +07:00)
  • X @__asuramus
View GitHub Profile
@anubra266
anubra266 / Readme.md
Last active February 11, 2024 00:13
Laravel Queue Email Verify and Password Reset Mails

Laravel Queue Email Verify and Password Reset Mails

First step is to overwrite the default methods in your User Model.

NB: We are still using the default Laravel Notifications.

# App/Models/User.php

php
@Aslam97
Aslam97 / laravel_change_user_password.md
Last active October 11, 2021 13:54
Laravel change user password

Laravel change user password

Create Custom Validation Rules

  • Create CheckPassword rules

php artisan make:rule CheckPassword

use Illuminate\Contracts\Validation\Rule;
@ankurk91
ankurk91 / laravel_horizon.md
Last active April 21, 2024 01:27
Laravel Horizon, redis-server, supervisord on Ubuntu server

Laravel Horizon, redis-server, supervisord on Ubuntu 20/22 server

Laravel 8+, Horizon 5.x, Redis 6+

Parepare application

  • Install and configure Laravel Horizon as instructed in docs
  • Make sure you can access the Horizon dashboard like - http://yourapp.com/horizon
  • For now; it should show status as inactive on horizon dashbaord

Install redis-server

@morcegon
morcegon / .htaccess
Created March 21, 2018 13:35
.htaccess optimized for laravel
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
@jeffochoa
jeffochoa / Response.php
Last active April 30, 2024 10:45
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@RadGH
RadGH / short-number-format.php
Last active April 9, 2024 11:28
Short Number Formatter for PHP (1000 to 1k; 1m; 1b; 1t)
<?php
// Converts a number into a short version, eg: 1000 -> 1k
// Based on: http://stackoverflow.com/a/4371114
function number_format_short( $n, $precision = 1 ) {
if ($n < 900) {
// 0 - 900
$n_format = number_format($n, $precision);
$suffix = '';
} else if ($n < 900000) {