Skip to content

Instantly share code, notes, and snippets.

View enimiste's full-sized avatar

NOUNI El bachir enimiste

View GitHub Profile
@enimiste
enimiste / composer.json
Created May 23, 2016 21:44
Laravel IDE Helper requirements to add to your composer.json file
{
"require-dev": {
"barryvdh/laravel-ide-helper": "v2.1.4",
"doctrine/dbal": "~2.3"
},
}
@enimiste
enimiste / toolBasedOnSymfonyConsoleXmlOptionBug.php
Last active May 23, 2016 21:45
Fix the erreur : --xml option not found when creating "Command Line Tool Support" on PhpStorm
<?php
/* This code to put on
* - artisan.php for Laravel >= 5.2 : Before initializing kernel.
* - bin/console for Symfony project : before initializing the ArrayInput object
*/
//Begin : fixe --xml Symfony console bug :
function listXmlCommandBugFixe() {
$argv = $_SERVER['argv'];
if (
isset( $argv[1] ) && $argv[1] == 'list' &&
@enimiste
enimiste / StringBuilder.php
Last active May 23, 2016 21:45
PHP StringBuilder
<?php
/**
* Created by PhpStorm.
* User: elbachirnouni
* Date: 08/03/15
* Time: 22:12
*/
namespace Nouni\String\Utils;
@enimiste
enimiste / app.blade.php
Last active May 24, 2016 14:09
Integration of AdminLTE theme on Laravel 5 project
<!DOCTYPE html>
<!--
The content of this gist to put on a file on your resource/views directory as layout of other views.
You should also install the theme using bower as follow : on you public directory run bower `install admin-lte`
The header, footer and sidebar files should go in a directory named 'inc' near current file
For more details visit https://almsaeedstudio.com/blog/integrate-adminlte-with-laravel
-->
<html>
<head>
<meta charset="utf-8">
@enimiste
enimiste / DebugContainerCommand.php
Created June 13, 2016 14:14
An artisan command to debug the bindings withing Laravel 5.2 container
<?php
namespace App\Console\Command;
use Illuminate\Console\Application;
use Illuminate\Console\Command;
use Illuminate\Container\Container;
class DebugContainerCommand extends Command {
/**
@enimiste
enimiste / annotations.php
Last active June 16, 2016 13:31
Utils Annotations
<?php
/**
* Class BaseAnnotation
*/
abstract class BaseAnnotation {
/**
* ApiDoc constructor.
*
@enimiste
enimiste / eloquent_model.php
Created June 23, 2016 01:56
Code that should be used with boolean database column in migrations
<?php
/*
* Assume that you have a column named "has_header" in your migration as follow
* $table->boolean('has_header');
*
* To set boolean values in your model you should add the code bellow
*/
/**
@enimiste
enimiste / blade_directives.php
Created July 10, 2016 11:41
@SInCE, @hide, @Date and @datetime blade custom directives
<?php
/*
* To add in the boot methode of your app service provider
*/
\Blade::directive( 'date',
function ( $exp ) {
return "<?php echo with($exp)->format('d/m/Y'); ?>";
} );
@enimiste
enimiste / BusinessEvent.php
Created July 13, 2016 17:07
BusinessEvent class for laravel 5 apps
<?php
/**
* Created by PhpStorm.
* User: elbachirnouni
* Date: 13/06/2016
* Time: 11:20
*/
namespace Com\NextGen\Business\Common\Events;
@enimiste
enimiste / BusinessCommand.php
Created July 13, 2016 17:08
Console BusinessCommand class for Laravel 5 apps
<?php
/**
* Created by PhpStorm.
* User: elbachirnouni
* Date: 24/06/2016
* Time: 01:42
*/
namespace Com\NextGen\Business\Common\Console;