Skip to content

Instantly share code, notes, and snippets.

View murdercode's full-sized avatar
🔥
On Fire!

Stefano Novelli murdercode

🔥
On Fire!
View GitHub Profile
TODO
----
In FastCGI config
```
server {
#...
@murdercode
murdercode / laravel-fastcgi-cache-config.md
Last active June 22, 2024 06:09
Optimizing Laravel (and Nova) with FastCGI Cache Configuration

Laravel + FastCGI Cache = ❤️

⚠️ Need a more specific guide? See https://medium.com/@murdercode/speed-up-your-laravel-application-up-to-1000x-with-fastcgi-cache-0135b11407e5

Using FastCGI cache allows you to speed up your website up to 1000x. In fact, the FastCGI cache (or Varnish) mechanism consists of putting a server-caching mechanism between a client and your web server. The whole page will be cached as an HTML output, and it will be delivered instead of using the PHP/MySQL/Redis stack, etc. for all users, but only for the first visit (and others after some specified time).

WARNING: This is not a take-away how-to. Please read it carefully and use it at your own risk.

This config is based on the ploi.io stack. We will not cover the FastCGI installation process, so please prepare FastCGI and adapt the next config if you need it.

Keybase proof

I hereby claim:

  • I am murdercode on github.
  • I am murdercode (https://keybase.io/murdercode) on keybase.
  • I have a public key whose fingerprint is C2A1 D2CE 2B02 AD13 0119 43AF 2043 4455 BACC 5F3D

To claim this, I am signing this object:

@murdercode
murdercode / nova4-auth0.md
Last active December 4, 2023 08:29
Laravel Nova 4 + Auth0

Nova 4 + Auth0 = ❤️

Hi folks! After a day of *#!$", DispatchCode and I have realized a working installation of Nova4 with Auth0 support. Here's our conclusions, if you want to try it :)

2. Create the Custom Auth

Create a file in \app\Auth\CustomUserRepository.php and add the following code:

@murdercode
murdercode / ArticleController.php
Last active October 13, 2021 15:02
Tiptap + VueJS3 + Laravel + InertiaJS
<?
public function uploadImage()
{
// Maybe in the future TODO: remove when deleting those or article itself
request()->validate([
'file' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:4096',
]);
// WORKING: Store Original
$original = request()->file('file')->store('public/articlesInline');
@murdercode
murdercode / ArticleController.php
Last active October 13, 2021 15:03
Return view as xml (rss)
<?
// Tested on Laravel 8.54
use Illuminate\Support\Facades\Response;
return Response::view('rss', [
'key' => 'value'
])->header('Content-Type', 'application/xml');