dinesh/helper

1,436 2
Install
composer require dinesh/helper
Latest Version:0.4
PHP:>=5.3.0
License:MIT
Last Updated:Sep 3, 2015
Links: GitHub  ·  Packagist
Maintainer: Dinesh
Example to file ajax data

{{ DNS::ajax_fill_dropdown('country_id','state_id',URL::to('ajax/states')) }}
{{ DNS::ajax_fill_dropdown('country_id','state_id',URL::to('ajax/states'),array('statea_id','stateb_id')) }}
{{ DNS::imgBase64("data:image/png", DNS::code128BarCode(123456, 1,'PRODUCT')) }}
{{ DNS::getUniqueFilename() }}



class AjaxController extends BaseController {

    public function postStates($param = array()) {
        $list = array();

        if (Input::get("country_id")) {
            $list = State::where("country_id", "=", Input::get("country_id"))->lists("name", "id");
        } else if (Input::old("country_id")) {
            $list = State::where("country_id", "=", Input::old("country_id"))->lists("name", "id");
        } elseif (isset($param['country_id'])) {
            $list = State::where("country_id", "=", $param['country_id'])->lists("name", "id");
        }
        return $list;
    }
}

use DNS::getQueryLog()  to get query with parameter 


Add Captcha

->with('math_captcha', DNS::create_mathas_captcha());


<div class="control-group {{ $errors->has('captcha') ? 'error' : ''}}">
    <h3 style="padding-left: 25px;">
        <span>
            {{$math_captcha['first_digit']}}
            {{$math_captcha['operand']}}
            {{$math_captcha['second_digit']}}
            = 
        </span>
        {{ Form::text('captcha', null,array('class'=>'span1','style'=>'display: inline-block;margin-top: 11px;'))}}
        (?)
    </h3>
    {{ $errors->first('captcha', '<span class="help-inline">:message</span>') }}
    <!--<p style="padding: 0;margin: 0;color: red;font-size: 13px;font-weight: bolder;">ઉપર ના સરવાળા કે બાદબાકી નું પરિણામ અહિં લખો</p>-->
</div>


Validator::extend('check_captcha', function($attribute, $value, $parameters)
{
    return DNS::check_captcha($value);
});

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

641,106,524 9,700
laravel/framework

The Laravel Framework.

593,882,149 34,959
laravel/tinker

Powerful REPL for the Laravel framework.

502,645,077 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

418,291,778 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
0.4 >=5.3.0 4.x MIT
0.3 >=5.3.0 4.x MIT
0.2 >=5.3.0 4.x MIT
0.1 >=5.3.0 4.x