Skip to content

Instantly share code, notes, and snippets.

/.idea
/.vscode
/.vs
/node_modules
/vendor
@Muetze42
Muetze42 / nova-check-if-filter-is-active.php
Last active November 10, 2021 09:52
Laravel Nova: Check if filter is active
<?php // Functions
if (!function_exists('decodeNovaFilter')) {
/**
* Decode the filter string from base64 encoding.
*
* @param string $filtersRequestString
* @return array
*/
function decodeNovaFilter(string $filtersRequestString): array
{
@Muetze42
Muetze42 / nova-indexquery-default-order.php
Last active November 10, 2021 09:52
Laravel Nova: indexQuery Default order
<?php
/**
* The column by which to sort as default
*
* @var string
*/
public static string $defaultSort = '';
/**
@Muetze42
Muetze42 / NovaNoDuplicateRelations.php
Last active November 10, 2021 09:51
Nova: Prevent duplicate relation attachment
<?php
namespace App\Traits\Nova;
use Illuminate\Database\Eloquent\Builder;
use Laravel\Nova\Http\Controllers\AttachableController;
use Laravel\Nova\Http\Requests\NovaRequest;
trait NoDuplicateRelations
{
@Muetze42
Muetze42 / add-windows-context-menu-item.bat
Last active November 10, 2021 09:51
Tested with Windows 11, but should work with older Windows Versions too (Example with Umlauts for Mp3tag)
goto comment
/*
|--------------------------------------------------------------------------
| Instruction
|--------------------------------------------------------------------------
|
| * With Notepadd++
| * [For specialchars and Umlauts] `Encoding` => `Convert to ANSI`
| * [For specialchars and Umlauts] `Language` => `M` => `MS-Dos Style`