Skip to content

Instantly share code, notes, and snippets.

View ManojKiranA's full-sized avatar
🔍
Focusing

Manoj Kiran ManojKiranA

🔍
Focusing
  • Postiefs Technologies Private Limited
  • Coimbatore
View GitHub Profile
@odan
odan / xampp_php7_xdebug.md
Last active April 9, 2025 13:07
Installing Xdebug for XAMPP
<?php
namespace App\Merge;
class Marge
{
protected $data = [];
public function setData($data)
{
@shgysk8zer0
shgysk8zer0 / README.md
Created February 10, 2017 06:28
Generate random images in PHP

Generate random images in PHP

sample

Why?

  • Because you can
  • Because you have time to spare
  • Maybe you think they look cool or want to save them for wallpapers or something
  • Maybe it reminds you of that one time... You know which time I'm talking about

Requirements

<?php
/**
* Automatically alias Laravel Model's to their base classname.
* Ex: "App\Models\User" now can just be accessed by "User"
*/
if (! function_exists('aliasModels')) {
function aliasModels() {
$finder = new \Symfony\Component\Finder\Finder();
$finder->files()->name('*.php')->in(base_path().'/app');
@reinink
reinink / AppServiceProvider.php
Created July 20, 2017 17:04
Eloquent addSubSelect()
<?php
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\Query\Expression;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@brunogaspar
brunogaspar / macro.md
Last active November 25, 2024 11:01
Recursive Laravel Collection Macros

What?

If a nested array is passed into a Laravel Collection, by default these will be threaded as normal arrays.

However, that's not always the ideal case and it would be nice if we could have nested collections in a cleaner way.

This is where this macro comes in handy.

Setup

@Yentel
Yentel / HttpCode.php
Created January 18, 2018 15:30
PHP Class with all HTTP Status codes (Laravel)
<?php
namespace App\Http;
class HttpCode
{
/*
* HTTP Status Codes & their meaning
* Source: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
* By: Yentel Hollebeke - https://github.com/yentel
@adamwathan
adamwathan / 1-add-macros.php
Last active June 11, 2022 19:55
Multiformat Endpoints in Laravel
<?php
namespace App\Providers;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Illuminate\Support\ServiceProvider;
use App\Http\Middleware\CaptureRequestExtension;
class AppServiceProvider extends ServiceProvider
@cesargb
cesargb / LogProcessorServiceProvider.php
Last active June 20, 2024 07:46
Laravel Log Processor
<?php
namespace App\Providers;
use App;
use Monolog\Processor\GitProcessor;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\ServiceProvider;
use Monolog\Processor\MemoryUsageProcessor;
@BenQoder
BenQoder / Laravel Homestead SSL
Created July 26, 2018 11:49
This Is The Step I Follow To Make My Laravel Projects Have SSL Certificates Locally
vagrant up && vagrant ssh
cp /etc/nginx/ssl/ca.homestead.homestead.crt /home/vagrant/{Projects Folder}
On Mac, Open terminal and cd into Projects Folder then
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ca.homestead.homestead.crt
On Windows, Import certificate as trusted into chrome or preferred browser