Skip to content

Instantly share code, notes, and snippets.

@Nks
Nks / Button.php
Last active March 15, 2019 17:54
orchid rows button
<?php
declare(strict_types=1);
namespace App\Orchid\Fields;
use Orchid\Screen\Field;
class Button extends Field
@Nks
Nks / HomePage.php
Last active February 2, 2019 17:20
Flexible content block
<?php
declare(strict_types=1);
namespace App\Orchid\Entities;
use App\Orchid\Layouts\HomePage\FlexibleContent\TestLayout;
use Nakukryskin\OrchidFlexibleContentField\Screen\Fields\FlexibleContentField;
use Orchid\Press\Entities\Single;
use Orchid\Screen\Fields\InputField;
@Nks
Nks / MediaVideoConverterListener.php
Last active September 20, 2024 02:07
Laravel Media Library converting video to .mp4 after saving
<?php
namespace App\Listeners;
use App\Media;
use FFMpeg\FFMpeg;
use FFMpeg\Format\Video\X264;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\SerializesModels;
@Nks
Nks / create_host_php.sh
Created September 16, 2016 19:29
Automatically creating new virtual hosts for nginx with support of the php-fpm
#!/bin/bash
# @author: Seb Dangerfield
# http://www.sebdangerfield.me.uk/?p=513
# Created: 11/08/2011
# Modified: 07/01/2012
# Modified: 27/11/2012
# @author Zhdanov Vladislav
# https://github.com/nks
# Modified 16/09/2016
@Nks
Nks / Model.php
Created August 18, 2016 15:30
Laravel 5.2 user spy-fields (created_by, updated_by, deleted_by) support
<?php
namespace App\Models;
use Auth;
use Illuminate\Database\Eloquent\Model as BaseModel;
class Model extends BaseModel
{
protected $userAttributes = [];