Skip to content

Instantly share code, notes, and snippets.

View nasrulhazim's full-sized avatar
🎯
Focusing

Nasrul Hazim Bin Mohamad nasrulhazim

🎯
Focusing
View GitHub Profile
@nasrulhazim
nasrulhazim / GitHubController.php
Created May 6, 2020 21:55
Webhook Handler Controller
<?php
namespace App\Http\Controllers\Webhooks;
use App\Http\Controllers\Controller;
use App\Models\WebhookCall;
use App\WebhookClient\SignatureValidator\GitHubSignatureValidator;
use Illuminate\Http\Request;
use Spatie\WebhookClient\WebhookConfig;
use Spatie\WebhookClient\WebhookProcessor;
@nasrulhazim
nasrulhazim / GitHub.php
Created May 6, 2020 21:53
GitHub Payload
<?php
namespace App\WebhookClient\Payload;
use App\Contracts\WebhookPayload;
use Illuminate\Support\Str;
class GitHub implements \App\Contracts\WebhookPayload
{
protected $header;
@nasrulhazim
nasrulhazim / laravel.yml
Created April 23, 2020 13:59
GitHub Action for Laravel
name: Unit Test
on:
push:
branches:
- develop
pull_request:
branches:
- develop
release:
@nasrulhazim
nasrulhazim / LearnMiddlewareTest.php
Last active April 14, 2020 00:30
Learn Middleware Test
<?php
namespace Tests\Feature;
use App\Http\Middleware\LearnUnitTestMiddleware;
use Tests\TestCase;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Mockery;
@nasrulhazim
nasrulhazim / LearnMiddlewareTest.php
Last active April 14, 2020 00:31
Learn Middleware Test
<?php
namespace Tests\Feature;
use App\Http\Middleware\LearnUnitTestMiddleware;
use Tests\TestCase;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Mockery;
@nasrulhazim
nasrulhazim / LearnUnitTestMiddleware.php
Last active April 13, 2020 20:52
Learn Unit Test Middleware
<?php
namespace App\Http\Middleware;
use Closure;
class LearnUnitTestMiddleware
{
/**
* Handle an incoming request.
@nasrulhazim
nasrulhazim / layout.blade.php
Created December 31, 2019 10:52
Section to remove in Laravel Nova layout
@foreach (\Laravel\Nova\Nova::availableTools(request()) as $tool)
{!! $tool->renderNavigation() !!}
@endforeach
@nasrulhazim
nasrulhazim / NovaServiceProvider.php
Created December 31, 2019 10:49
Register Dashboard Menu in Nova
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Laravel\Nova\Nova;
use Laravel\Nova\NovaApplicationServiceProvider;
class NovaServiceProvider extends NovaApplicationServiceProvider
{
@nasrulhazim
nasrulhazim / Card.vue
Created December 31, 2019 10:45
Custom Navigation using Laravel Nova Dashboard.
<template>
<div>
<card class="p-2 m-1 w-full" v-for="item in card.menus" :key="item.group">
<div class="tab__header">
<a href="#" class="tab__link p-4 block no-underline flex justify-between" @click.prevent="active = !active">
<strong class="text-80">{{ item.group }}</strong>
<span class="down-Arrow text-80" v-show="!active">&#9660;</span>
<span class="up-Arrow text-80" v-show="active">&#9650;</span>
</a>
@nasrulhazim
nasrulhazim / DashboardMenu.php
Last active January 2, 2020 00:09
Dashboard Menu for Laravel Nova
<?php
namespace NasrulHazim\DashboardMenu;
use Laravel\Nova\Card;
use Laravel\Nova\Nova;
use Illuminate\Support\Str;
class DashboardMenu extends Card
{