Skip to content

Instantly share code, notes, and snippets.

View jalallinux's full-sized avatar
🌵
ABC: Always Be Coding

JalalLinuX jalallinux

🌵
ABC: Always Be Coding
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jalallinux on github.
  • I am jalal_linux (https://keybase.io/jalal_linux) on keybase.
  • I have a public key ASDRExI2P8_-cR9w_IPe9_s0y9GxhNiI_FC900bytqRLFwo

To claim this, I am signing this object:

@jalallinux
jalallinux / UseUuidPrimary.php
Last active March 5, 2022 07:53
Laravel: UseUuid trait
<?php
namespace App\Models\Traits;
use Illuminate\Database\Eloquent\Model;
trait UseUuidPrimary
{
protected static function bootUseUuidPrimary()
{
@jalallinux
jalallinux / BaseEloquentRepository.php
Last active March 5, 2022 07:53
Laravel: Base Repository Pattern
<?php
namespace App\Repositories\Eloquent;
use App\Repositories\BaseRepository;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
@jalallinux
jalallinux / postman-performance-test.js
Last active March 28, 2022 06:29
Postman: Performance Test
pm.test("Successful request", function () {
pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);
});
pm.test("Response time is less than 217ms.", function () {
pm.expect(pm.response.responseTime).to.be.below(217);
});
pm.test("Response time is less than 317ms", function () {
pm.expect(pm.response.responseTime).to.be.below(317);
@jalallinux
jalallinux / WithUuidColumn.php
Last active March 5, 2022 07:52
Laravel: Use uuid column separately
<?php
namespace App\Models\Traits;
use Illuminate\Database\Eloquent\Model;
trait WithUuidColumn
{
protected static function bootWithUuidColumn()
{
@jalallinux
jalallinux / Handler.php
Last active March 5, 2022 10:45
Laravel: Convert validation rules exception to another exception
<?php
namespace App\Exceptions;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Validation\ValidationException;
@jalallinux
jalallinux / controller.model.api.stub
Created October 8, 2022 12:47
Laravel - Controller Model API Stub
<?php
namespace {{ namespace }};
use {{ rootNamespace }}Http\Controllers\Controller;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Illuminate\Http\JsonResponse;
use App\Repository\Contracts\{{ model }}Contract;
/**
@jalallinux
jalallinux / observer.stub
Last active October 8, 2022 12:48
Laravel - Observer Stub
<?php
namespace {{ namespace }};
use {{ namespacedModel }};
class {{ class }}
{
/**
* Handle the {{ model }} "creating" event.
@jalallinux
jalallinux / Dockerfile
Last active October 16, 2022 12:12
Laravel Best Dockerization
FROM jalallinux/laravel-9:php-80
LABEL maintainer="JalalLinuX"
ENV TZ=Asia/Tehran
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY . /app/path
WORKDIR /app/path
@jalallinux
jalallinux / interesting-things.md
Last active October 29, 2022 05:05
🥳 Interesting Things 🎉

Interesting Things

  • Metabase is an open-source business intelligence platform. You can use Metabase to ask questions about your data, or embed Metabase in your app to let your customers explore their data on their own.


  • Sonatype Nexus is a repository manager that organizes, stores and distributes artifacts needed for development. With Nexus, developers can completely control access to, and deployment of, every artifact in an organization from a single location, making it easier to distribute software.