Skip to content

Instantly share code, notes, and snippets.

@aliirfaan
aliirfaan / Create_Laravel_Pipeline.txt
Created September 20, 2024 06:12 — forked from omaryoussef/Create_Laravel_Pipeline.txt
Creates a Filebeat pipeline to ingest Laravel Monolog/log lines.
PUT _ingest/pipeline/laravel
{
"description": "Parses Laravel log files.",
"processors": [
{
"rename": {
"field": "message",
"target_field": "event.original"
}
},
@aliirfaan
aliirfaan / laravel-production-permissions.md
Created June 19, 2023 06:04 — forked from barbietunnie/laravel-production-permissions.md
MySQL Database User GRANT permissions for Laravel

MySQL Database User GRANT permissions for Laravel

For security reasons, you should probably grant select, delete, update and insert to your app user in production.

Have another user who can do alter, create, drop and index when running migrations.

If you run seeders in production, also grant select, insert and references to the migration user.

Yeah, 2 users, migrations are not always run in production everyday and this keeps more secure your database.

# API Design Guidelines
# Introduction
The PayPal platform is a collection of reusable services that encapsulate well-defined business capabilities. Developers are encouraged to access these capabilities through Application Programming Interfaces (APIs) that enable consistent design patterns and principles. This facilitates a great developer experience and the ability to quickly compose complex business processes by combining multiple, complementary capabilities as building blocks.
PayPal APIs follow the [RESTful][0] architectural style as much as possible. To support our objectives, we have developed a set of rules, standards, and conventions that apply to the design of RESTful APIs. These have been used to help design and maintain hundreds of APIs and have evolved over several years to meet the needs of a wide variety of use cases.
We are sharing these guidelines to help propagate good API design practices in general. We have pulled extensively from the broader community and believe that it is importan
composer create-project --prefer-dist laravel/laravel .
@aliirfaan
aliirfaan / mu_phone_regex.txt
Created February 4, 2021 07:37
Mauritius mobile phone regex
/^5\d{7}$/
@aliirfaan
aliirfaan / person_nam_regex.php
Created February 4, 2021 07:36
Person name regex
$pattern = '/^[A-Za-z\x{00C0}-\x{00FF}][A-Za-z\x{00C0}-\x{00FF}\'\-]+([\ A-Za-z\x{00C0}-\x{00FF}][A-Za-z\x{00C0}-\x{00FF}\'\-]+)*/u';
@aliirfaan
aliirfaan / laravel_api_resource.txt
Last active February 2, 2021 05:46
Laravel API resource format
// create resource, change <ApiResponseCollection> according to your needs
php artisan make:resource <ApiResponseCollection>
// implementation
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\ResourceCollection;
@aliirfaan
aliirfaan / create_db.sql
Created January 29, 2021 11:08
Create MySQL database with collation
/* replace <mydatabase> with your database name */
CREATE DATABASE <mydatabase> CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;