Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View imanghafoori1's full-sized avatar

Iman imanghafoori1

  • Freelance
  • The milky way
View GitHub Profile
//- As you may know, Laravel 5 provides the Elixir to compile assets with no pain.
These mixins is for those of you who want to use Jade power combined with that of Laravel Blade.
The syntax mimic Blade statements, however identation differs in some cases.
- var newline = "\r\n"
- var loopIterator = '$iterator'
//- @extends mixin
Example: +extends('layouts/master')
Compiled: @extends('layouts/master')
@imanghafoori1
imanghafoori1 / benchmark.php
Created July 31, 2019 19:56
compare type hint performance hit
<?php
function a1(int $a,int $b) : int {
return $a + $b;
}
function a2( $a, $b){
return $a + $b;
}
<?php
class LoginController
{
function Login(Request $request)
{
$this->validateRequest($request);
$this->throttleAttemps($request);
<?php
class AuthController {
public function login(Request $request)
{
$validator = Validator::make($request->all(), [
'email' => 'required|max:255||string',
'password' => 'required|confirmed||string',
]);
if ($validator->fails()) {
<?php
function sendAndExit($response)
{
$request = app('request');
// send the response to the users browser
app('router')->prepareResponse($request, $response)->send();
// dispatches an event
app('events')->dispatch(new \Illuminate\Foundation\Http\Events\RequestHandled($request, $response));
@imanghafoori1
imanghafoori1 / formhelper.php
Created October 11, 2015 23:14
laravel form builder supplimentary
<?php
namespace App\Form;
use Kris\LaravelFormBuilder\Form;
/**
* @method FieldOptionSetters text( string $field_name, array $options =[] , boolean $modify = false)
//- As you may know, Laravel 5 provides the Elixir to compile assets with no pain.
These mixins is for those of you who want to use Jade power combined with that of Laravel Blade.
The syntax mimic Blade statements, however identation differs in some cases.
- var newline = "\r\n"
- var loopIterator = '$iterator'
//- @extends mixin
Example: +extends('layouts/master')
Compiled: @extends('layouts/master')
//- As you may know, Laravel 5 provides the Elixir to compile assets with no pain.
These mixins is for those of you who want to use Jade power combined with that of Laravel Blade.
The syntax mimic Blade statements, however identation differs in some cases.
- var newline = "\r\n"
- var loopIterator = '$iterator'
//- @extends mixin
Example: +extends('layouts/master')
Compiled: @extends('layouts/master')