vendredi 30 juin 2017

Dynamic filter collection laravel

I'm working on a filter that i need to use in my system. I have a database table like this:

id - respondent_id - value
1       10            p1
2       10            Male 
3       10            13-19 year
4       11            p2
5       11            female
6       11            20-29 year      
7       12            p2
8       12            Male 
10      13            13-19 year    
11      13            p2
11      13            female
11      13            13-19 year    

for my filter i need to grab for example al the respondent_id's which have the value p2 and have the age 13-19. This filter is dynamic so a other time you can say i need p1 / male / 13-19 year.

How can i reach that when i filter on this for example:

Filter: p2 / female / 13-19 year

that is get respondent 11 and 13 and not 10 and 12

so far i tried this:

 foreach($root[0] as $respondent) {
                $output = $root[0]->filter(function ($value) use ($root, $respondent, $status) {
                    for ($x = 1; $x < count($root); $x++) {
                        foreach ($root[$x] as $respondent) {
                            if ($value === $respondent) {
                                $status = true;
                            }
                        }
                    }

                    return $status;
                })->values()->all();
            }

Here $root stands for a collection with multiple collections which hold the values for each filter. And from there i tried to compare the first collection with the other collections to see which respondent_id they have in common. at this stage it always skips 1 filter.

Any suggestions how to do this.



via Chebli Mohamed

How do I carry a record number into a Laravel job failed method

Using Laravel 5.1. I'm trying to write a job and make a table record (log) of the fact that the job has been started, that it's been completed and if it's failed. I've created a parent class (JobBase) that extends Job implements SelfHandling, ShouldQueue which has a before() method, an after() method and per the documentation a public failed method. In the handle() method of the I call before() before doing any processing and at the completion of processing I call after(). JobBase has a class variable that is supposed to retain the value of the log record inserted in before() and then used to update the record in after() or failed(). However regardless of scope of the class variable, when the failed() method executes the variable is the default value, now what was set in the before() method. It appears as if a new instantiation of the class is created for the failed method.

So how would I retain the record number for the failed() method?

Note - using 5.1 because we need to run on Google App-Engine and that appears to be the only version with tools for it.

Thanks in advance.



via Chebli Mohamed

jeudi 29 juin 2017

Issue while trying to append route parameter in js

Below is my js code that is appending the route and its parameter in anchor tag.

var href = "{!! route('ShowUserMainForm', ['RoleID'=>" + row.RoleID + "]) !!}";

var UserColumn = "<td><a href=' " + href + "'><button>Users</button></a></td>";

It gives below url

http://localhost:1234/system-users/RoleID?%20+%20row.RoleID%20+%20

I am expecting below.

http://localhost:1234/system-users/1

Am I missing anything?



via Chebli Mohamed

Ways to prevent TokenMismatch Exception

I have analyze that ratio of getting Token Mismatch Error is very high. And this error getting because of some of the silly mistakes. There are many reasons developers are doing mistakes. Here are some of the examples.

  1. Not sending _token on header.
  2. Not sending _token on data when using ajax.
  3. Not Permission on Storage Path.
  4. Invalid Session Storage path.

And there many other reasons, feel free to edit this question for more more ways to prevent this type of error.



via Chebli Mohamed

mardi 27 juin 2017

Laravel get number of failed login attempt

I am using Laravel 5.4 just trying to get the number of failed login attempt from controller as shown below.. It always returns 0 but hasTooManyLoginAttempts works fine. anyone has any ideas?

In LoginController.php

protected function hasTooManyLoginAttempts(Request $request)
{
    return $this->limiter()->tooManyAttempts(
        $this->throttleKey($request), 3, 1
    );
}

Above code works fine by locking user for 1 minute if there is failed login attempt of 3 times. But I want to get the count of login attempt.based on below code

public function tooManyAttempts($key, $maxAttempts, $decayMinutes = 1)
{

    echo $this->attempts($key);
    exit;

    if ($this->cache->has($key.':lockout')) {
        return true;
    }

    if ($this->attempts($key) > $maxAttempts) {
        $this->lockout($key, $decayMinutes);

        $this->resetAttempts($key);

        return true;
    }

    return false;
}

echo $this->attempts($key); always returns 0.how do we figure out this?



via Chebli Mohamed

lundi 26 juin 2017

Two laravel projects in the same server. Conflict with Auth login

When i am login with project1 and then i login to project2. My project1 will log out. How can i login the same time with two laravel projects?

i try to change config/session.php by change path

Project1- config/session.php default 'path' => '/',

Project2- config/session.php i change to 'path' => '/pa',

But i can't login with project 2 How can login with Auth with two laravel projects with the same server??



via Chebli Mohamed

dimanche 25 juin 2017

How to inpute text Value renders as html entity in Vue. some stuffs i check and not solved area

HTML:

if the 'item.name' contains the Unicode or special character to decode the html we use. or Logan's

example: if the name is Logan's - => Logan's - } => Logan's not working - <p v-html="item.name"></p> not working on Edit the data.

How to Solve this problem ??? it is not working properly inside the input



via Chebli Mohamed

mercredi 21 juin 2017

Laravel No query results for model [App\Topic] create

I'm trying to get a view where the user is able to create a topic. I did this many times in my project but never got this error, Because all of the other ones work just fine.

I get the error No query results for model [App\Topic] create. Here is the code.

This is the link that is supposed to bring the user to the view.

        <div class="col s12">
            <div class="card">
                <div class="card-content clearfix">
                    <a href="" class="waves-effect waves-light btn blue-grey darken-4">New topic <i class="material-icons right">edit</i></a>
                </div>
            </div>
        </div>

These are the routes that are used in this problem.

Route::get('/theme/{theme_id}/topics/create', 'TopicsController@create')->name('createtopic');
Route::post('/theme/{theme_id}/topics/create', 'TopicsController@store')->name('savetopic');

The Controller method create.

dd('Hij is er ' . $id);

And the store method is empty, The link doesn't show the DumpDie method but shows me the error instead. So there is no need to post the view i'm trying to display because that's not where the problem is. Thanks in advance!



via Chebli Mohamed

How can I print data in every selecting data in drop-down list with out loading page(real time)

How can I get data in database in every selecting data in drop-down list using JQuery or VueJS in laravel 5.1

  1. I display the data in drop-down`
<div class="form-group">
                        <label>Customer Name:</label>
                        <select class="form-control" name="customer_name" id="customer_name">
                            <option value="">-- Customer Name --</option>
                            @foreach(App\Customer::where('active', 1)
                                    ->where('process_id', 1)
                                    ->get()
                             as $cn)
                                <option value=""></option>
                            @endforeach
                        </select>
                    </div>
  1. I create onchange they get the value of drop-down (which is the id of customer name)
<script>
    $("#customer_name").change(function ()
    {
        var customer = document.getElementById("customer_name").value;
        document.getElementById("ct").value = customer

    });

</script>
  1. Displaying data depend of want selected data(sample only)
 <input type="text" style="border: 1px solid #505050;" readonly=true id="ct" value="">

Database like this

Customer Table

`Id customer_name series customer_code`
 1  Avon          01      AV
 2  Alaska        23     AL
 3  DelMonte      25     DM

The output is something like this customer_code - series - date now

  • AV-01-062117
  • AL-23-062117
  • DM-25-062117

    If I have a wrong format please correct me. Thank you



via Chebli Mohamed

Laravel Promocodes FatalErrorException

I'm uisng laravel 5.1 Add promocodes in laravel following github ( http://ift.tt/2sA3qNN /Promocodes )in that github guid completed upto Usagegenerate generating Promotional codes using generate method. Got this error

FatalErrorException in PromocodesServiceProvider.php line 22: Class 'Trexology\Promocodes\Facades\Promocodes' not found



via Chebli Mohamed

Laravel Elixer not able to minify and version javascript files

i am using laravel 5.1 elixer to manage, version, minify my application css and js

Below is my gulpfile.js

elixir(function (mix) {
    mix.less([
        'app.less',
        'creative.less',
        'mixins.less',
        'variables.less'
    ]).less([
        'dashboard.less',
        'component.less',
        'app-variables.less'
    ], 'public/css/dashboard.css')

    mix.scriptsIn('public/js/angular/controller', 'public/js/angular/appControllers.min.js');
    mix.scriptsIn('public/js/angular/service', 'public/js/angular/appServices.min.js');
    mix.scriptsIn('public/js/angular/directive', 'public/js/angular/appDerictives.min.js');

    mix.version([
        'public/css/dashboard.css',
        'public/css/app.css',
        'public/js/angular/appControllers.min.js',
        'public/js/angular/appServices.min.js',
        'public/js/angular/appDerictives.min.js'
    ]);
});

Everything works fine when i run the command gulp, i get the compiled files and also the versions files are now in the build folder.

The problem starts when i use gulp --production, When laravel starts the process is breaks when starting with scripts, below is the error -

events.js:141
 throw er; // Unhandled 'error' event
 ^
Error at new JS_Parse_Error (eval at <anonymous (/Users/apple/code/hireajackal/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:1534:18)
at js_error (eval at <anonymous> (/Users/apple/code/hireajackal/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:1542:11)
at croak (eval at <anonymous> (/Users/apple/code/hireajackal/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2089:9)
at token_error (eval at <anonymous> (/Users/apple/code/hireajackal/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2097:9)
at unexpected (eval at <anonymous> (/Users/apple/code/hireajackal/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2103:9)
at expr_atom (eval at <anonymous> (/Users/apple/code/hireajackal/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2630:9)
at maybe_unary (eval at <anonymous> (/Users/apple/code/hireajackal/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2792:19)
at expr_ops (eval at <anonymous> (/Users/apple/code/hireajackal/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2827:24)
at maybe_conditional (eval at <anonymous> (/Users/apple/code/hireajackal/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2832:20)
at maybe_assign (eval at <anonymous> (/Users/apple/code/hireajackal/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2856:20)

The problem is surely with the scriptsIn part of gulp file, or i could say that gulp is not able to minify the js files.

I have tried debugging this through multiple ways, but still not able to find the problem. Tried to update/downgrade the relevant packages, but even that didn't help.

Any help would be appreciated.



via Chebli Mohamed

mardi 20 juin 2017

How to acces to output data laravel

I need to display vendors without repeat, but i have large bd. Here is my query:

$model = Driver::select(DB::raw('vendor, COUNT(' . $field . ') AS s'))-
>groupBy('vendor')->pluck('s', 'vendor')->toArray();

It displays how many drivers have each vendor and returm massive: I'm using twig template and when i try to display this massive with this code:



It's just show me numbers, but i need vendors names. I tried to use

groupBy('vendor')



via Chebli Mohamed

Laravel 5.1 Eager Loading Cannot do additional where

I don't know what i'm doing wrong here but this code

$models = Model::with(['relationship' => function ($query) {
        $query->whereBetween('date', [$this->today->copy()->startOfDay(), $this->today->copy()->endOfDay()]);
    }])->where('status', 'active')->where('position', '!=', 'dev')->where('status', '=', 'good')->get();

doesn't work as expected. It does eager load the relationship it exists in the object but the problem is I cant do something like this

foreach($models as $model)
    {
        echo $model->relationship->where('status', '=', 'somestatus')->count() . '<br>';
    }

it returns 0 but when I check in database it is not 0. Do you guys know why does this code not work? Thank you guys.



via Chebli Mohamed

Conflict database when Multiple Laravel Projects on single machine

I am using Using xampp on windows 10. I have multiple laravel 5.2 projects on this machine. When I am executing Project 1 and it gives me error that database_project_1.table_of_project_2 table or view is not exists, but the table table_of_project_2 is exists in the database_project_2. This issue comes rarely.

Below is the Project 1 .env file

APP_ENV=local
APP_DEBUG=true
APP_KEY=base64:ratSluNv930gb3wp1UOabW6Ze3jEJn3ixtTX/wgqYZc=
APP_URL=http://project-1.dev/

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=database_project_1
DB_USERNAME=root
DB_PASSWORD=j@yshr33r@m

Below is the Project 2 .env file

APP_ENV=local
APP_DEBUG=true
APP_KEY=base64:XRgQHfYiKPmHtHZ5UbX38KDlBnl/nyBSt+8qnkOISTg=
APP_URL=http://project-2.dev/

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=database_project_2
DB_USERNAME=root
DB_PASSWORD=j@yshr33r@m

I have tried below commands but no luch:

  1. php artisan config:clear
  2. php artisan cache:clear

Please check below screenshot : Database Confict Error

Please anyone help me to solve this issue. Please let me know if any thing missing.



via Chebli Mohamed

lundi 19 juin 2017

Laravel 5.2 Error why simply trying to display a view

I created a view which allows the user to create a theme/post. The link to that view is in my navbar. But the problem is When I try to click the link (display the view) I get redirected to the home page without any errors whatsoever.

In the link of the navbar, i put <li><a href=""> which simply activates the route with the name "createtheme". This route is as followed: Route::get('/theme/create', 'ThemesController@create')->name('createtheme');. So this activated the create method in the ThemesController.php. Which is:

public function create()
{
    return view('themes.create');
}

So if I read this correctly, This is supposed to give me the right view, right? And it doesn't give me any errors so I don't know where to look.

This is the view I'm trying to display:

@extends('layouts.default')

@section('content')
<div class="container main-content">
    <div class="row first-row">
        <div class="col s12">
            <div class="card">
                <div class="card-content clearfix">
                    <span class="card-title">New theme</span>
                </div>
            </div>
            <div class="card">
                <div class="card-content">
                    <form method="POST" action="">
                        
                        <input type="hidden" name="user_id" value="">
                        <div class="row">
                            <div class="input-field col s6 has-error form-group">
                                <input id="title" class="form-control" type="text" name="title" placeholder="Title of topic">
                                <label for="title" class="active">Title of theme</label><span>Titel is mandatory!</span>
                            </div>
                            <div class="file-field input-field col s6 form-group">
                                <div class="btn cyan darken-1 disabled"><span>Attachment</span>
                                    <input id="attachement" type="file" name="attachment" class="disabled">
                                </div>
                                <div class="file-path-wrapper form-group">
                                    <input type="text" placeholder="geen" class="file-path validate form-control">
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col s12 form-group">
                                <textarea id="message-body" class="form-control" name="body"></textarea>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col s6">
                                Hier komen opties om het onderwerp te sluiten of
                                aan te geven dat het opgelost is, alleen bij bewerken
                            </div>
                            <div class="col s6">
                                <a href="" class="btn right cyan darken-1" type="submit">Save</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

@section('scripts')
<script type="text/javascript" src="">
</script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="">
</script>
@endsection

And here are the routes that are related to this problem.

Route::get('/theme/create', 'ThemesController@create')->name('createtheme');
Route::post('/theme/create', 'ThemesController@store');

And of course the Store method:

public function store(Request $request)
{
    Theme::create($request->input()); //Dit doet hetzelfde als bovenstaande

    return redirect('/');
}



via Chebli Mohamed

Pagination Laravel Problems

I want to do pagination on my search result, first of all i go to laravel documentation and find:

$users = User::where('votes', '>', 100)->paginate(15);

And for output:

<div class="container">
 @foreach ($users as $user)
    
 @endforeach
</div>



It's easy and simple, BUT i have in my View:

<ul class="pagination"> <!-- Previous Page Link --> <li class="disabled">
<span>&laquo;</span></li> <!-- Pagination Elements --> <!-- "Three Dots" 
Separator --> <!-- Array Of Links --> <li class="active"><span>1</span>
</li> <li><a href="http://ddrivers/search?page=2">2</a></li> <li><a 
href="http://ddrivers/search?page=3">3</a></li> <li><a 
href="http://ddrivers/search?page=4">4</a></li> <li><a 
href="http://ddrivers/search?page=5">5</a></li> <li><a 
href="http://ddrivers/search?page=6">6</a></li> <li><a 
href="http://ddrivers/search?page=7">7</a></li> <li><a 
href="http://ddrivers/search?page=8">8</a></li> <!-- "Three Dots" 
Separator --> <li class="disabled"><span>...</span></li> <!-- Array Of 
Links --> <!-- "Three Dots" Separator --> <!-- Array Of Links --> <li><a href="http://ddrivers/search?page=923">923</a></li> <li><a href="http://ddrivers/search?page=924">924</a></li> <!-- Next Page Link --> <li><a href="http://ddrivers/search?page=2" rel="next">&raquo;</a></li> </ul>

Where pagination sould be, first of all i connect bootstrap to my project(doesent help). How can i fix it?

View:

<tbody>
                

                </tbody>
            </table><!-- end table -->
        </div>

    </form>

    

Controller:

public function search() {
    $request = Request::all();
    $name = $request['name'];
    $result = Driver::where('vendor', $name)->paginate(25);
    return view('driver_search', [
        '_keywords' => $name ?: '',
        'query' => request('name'),
        'result' => $result,

    ]);
}



via Chebli Mohamed

middleware.dev redirected you too many times

I am running laravel version 5.4.26

my localhost project url is : middleware.dev. first time login in this url :

middleware.dev/login

,and login successfully completed. Then enter this url :

middleware.dev/admin

,then error message bellow

This page isn’t working

middleware.dev redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS

Kernel.php

<?php

namespace App\Http;

use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
    /**
     * The application's global HTTP middleware stack.
     *
     * These middleware are run during every request to your application.
     *
     * @var array
     */
    protected $middleware = [
        \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
        \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
        \App\Http\Middleware\TrimStrings::class,
        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
    ];

    /**
     * The application's route middleware groups.
     *
     * @var array
     */
    protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            // \Illuminate\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

        'api' => [
            'throttle:60,1',
            'bindings',
        ],
    ];

    /**
     * The application's route middleware.
     *
     * These middleware may be assigned to groups or used individually.
     *
     * @var array
     */
    protected $routeMiddleware = [
        'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
        'can' => \Illuminate\Auth\Middleware\Authorize::class,
        'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
        'role'=>\App\Http\Middleware\RoleMiddleware::class,
        'IsAdmin'=>\App\Http\Middleware\IsAdmin::class,


    ];
}

IsAdmin.php

<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;

class IsAdmin
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {

        $user =Auth::user();

        if ($user->isAdmin()){

            return redirect()->intended('/admin');
        }

                return $next($request);



    }
}

web.php

<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use Illuminate\Support\Facades\Auth;

Route::get('/', function () {

    return view('welcome');




});









Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');

Route::get('/admin/user/roles',['middleware'=>['role','auth','web'],function (){

    return 'Middleware role';
}]);

Route::get('/admin', 'AdminController@index');

AdminController.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class AdminController extends Controller
{
    //


    public function __construct()
    {
        $this->middleware('IsAdmin');
    }

    public function index(){

        return 'you are administretor becuse you ar sign in the page';
    }

}

User.php

<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    public function role(){
        return $this->belongsTo('App\Role');
    }

    public function isAdmin(){

        if ($this->role['name'] =='administrator'){

            return true;
        }

        return false;
    }
}



via Chebli Mohamed

How can I built a url with a named route?

Im trying to generate a url link using a named route. For example, i have http://myapp.com/{token} . But, I had been using a lot of function with route but the result that I have is http://myapp.com?token instead of http://myapp.com/token

What can I do?

The only way to generate the good url is using the function url without the name of url. For example: url( '/reset', [$token]) . But in this case, I am not using the name of the route where that is what I would like to use.

Real problem: I have a route like this:

// Password reset routes...
Route::get('reset/{token}', [
    'as' => 'password.reset',
    'uses' => 'Auth\PasswordController@getReset'
]);

A blade template:

<a href="">Click here to reset your password</a>
<br>
<a href="">Click here to reset your password</a>
<br>
{!! link_to_route('password.reset', 'Click here to reset your password', $token) !!}
<br>
<a href="">Click here to reset your password</a>

The result is:

<a href="http://ift.tt/2rNxEL8">Click here to reset your password</a>
<br>
<a href="http://ift.tt/2silEVL">Click here to reset your password</a>
<br>
<a href="http://ift.tt/2silEVL">Click here to reset your password</a>
<br>
<a href="http://ift.tt/2silEVL">Click here to reset your password</a>



via Chebli Mohamed

How to solve the error Route is not bound in laravel 5.1?

enter image description here

when runnig my view it shows the Route is not bound error.

following is my controller code public function assignRoles() {

    $title = trans('admin/privilegeduser.assign_roles');

    $routes = collect(Route::getRoutes()->getRoutes());

    $admin_routes = $routes->filter( function ($route) {

        if (array_has($route->getAction(), 'controller')) {

            $controller_action = array_get($route->getAction(), 

'controller');

            $is_admin_route = preg_match('/App\\\\Http\\\\Controllers\\\\Admin\\\\.*/', 
                $controller_action);

            return (is_numeric($is_admin_route) && ($is_admin_route > 0));

        }

        return false;

    }); 

    // dd($admin_routes);

    return view('app.admin.privilegeduser.assign_roles',compact('title','admin_routes'));

}

following is the view code

@extends('app.admin.layouts.default')

@section('title') } :: @parent @stop

@section('styles')

@endsection

@section('main')

                <div class="panel panel-success" data-sortable-id="ui-widget-11">
                    <div class="panel-heading">
                        <div class="panel-heading-btn">
                            <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                            <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-repeat"></i></a>
                            <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
                            <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-danger" data-click="panel-remove"><i class="fa fa-times"></i></a>
                        </div>
                        <h4 class="panel-title">  </h4> 
                    </div>
                    <div class="panel-body"> 
                      @include('utils.errors.list')
                      @include('flash::message')

                    <form action="" method="post">
                        <input type="hidden" name="_token" value="">
                            <div class="form-group">
                                <label class="control-label col-md-4 col-sm-4"> </label>
                                    <div class="col-md-6 col-sm-6">
                                        <a href="{!! url('admin/assign_role') !!}"><div id="new" class="btn btn-primary"></div></a>
                                    </div>
                                </div>
                                <div class="routes">
                                    @foreach ($admin_routes as $value)

                                    <input type="checkbox" name="admin_routes">

                                    @endforeach
                                </div>
                                <div class="btn col-sm-offset-4">
                                    <button type="submit" class="btn btn-primary"></button>
                            </div>
                        </form>
                    </div>
                </div>

@endsection

@section('scripts') @parent

<script>
    $(document).ready(function() {
        App.init();           
    });



</script>
@endsection



via Chebli Mohamed

Send variable to view

When i use

dd($name); 

It show's "name" in browser http://ift.tt/2rM1Q9B
But when i send it into .twig view

'query' => request('name'), 

 on view display input data.

I'm using same command's, here code of controller:

public function search() {
    $name = request('name');
    dd('name');
    $result = DB::table('drivers')
        ->where('name' , $name)
        ->get();
    return view('driver_search', [
        '_keywords' => $name ?: '',
        'query' => request('name'),
        'result' => $result,
    ]);

I need to send all matches with DB to view and then i will display it like





via Chebli Mohamed

vendredi 16 juin 2017

How can I mock unique validation rule?

I am writing test cases for a store() function of a ResourceController which adds a new resource in database.

I am not allowed to access database in my test cases, So I am mocking all the database interactions & now I need to mock the unique validation rule.

I have Googled it & even searched on the stackoverflow but I didn't found anything specific.

Here is what I know:- I can mock the \Validator::getPresenceVerifier() & \Validator::setPresenceVerifier() but if I mock them, then i will not be able to make the validator object. StackOverflow Question Here

Can anyone guide me in the right direction.



via Chebli Mohamed

jeudi 15 juin 2017

how can i select admin routes from a collection of routes in laravel5.1

this is the collection of routes i got

the following is my controller code

public function assignRoles(){

    $title = trans('admin/privilegeduser.assign_roles');


    $routecollection = Route::getRoutes();

}

The getRoutes() function in Router.php is given below

public function getRoutes(){

  return $this->routes;

}



via Chebli Mohamed

mercredi 14 juin 2017

Edit an exesting file Excel with framework Laravel

I want to edit an existing file named 'myfile', I want just to export it before adding some data...and I have this problem :


PHPExcel_Reader_Exception in Excel2007.php line 82:

Could not open C:\laravel\compta\files/Med for reading! File does not exist.

And this is my code in controller :


public function export(){

Excel::load('files/Med',function($excel) {

$excel->sheet('Sheetname', function($sheet) {

    // Sheet manipulation

});

})->export('xls');

}


How can I please export the file 'Med' ?



via Chebli Mohamed

Displaying Div without clicking radio button in update form

I have a form that uses JavaScript for displaying a div depending on what radio button was chosen. Now in my other form for the update, i'd applied the same java script but made few changes on displaying directly the div without clicking the radio button but it didn't work. How to do it correctly. Any help is much appreciated.

 <script type="text/javascript">
  function payment() {
    if (document.getElementById('installmentCheck').checked) {
      document.getElementById('installment').style.display = "block";
      document.getElementById('full').style.display = "none";
    }else if (document.getElementById('fullCheck').checked) {
      document.getElementById('full').style.display = "block";
      document.getElementById('installment').style.display = "none";
    }
  }
</script>


<div class="col-lg-6 ">
  <div class="form-group">
    <label class="control-label">
      Payment Scheme :
    </label>
    <div class="input-group ">
      <?php
      if ($scholarship->scholarship_payment != 'Full') {
        echo '<input type="radio" onclick="javascript:payment();" name="choosePaymentScheme" id="installmentCheck" value="Installment" checked > Installment &nbsp&nbsp&nbsp';
        echo '<input type="radio" onclick="javascript:payment();" name="choosePaymentScheme" id="fullCheck" value="Full"> Full';
      }else{
        echo '<input type="radio" onclick="javascript:payment();" name="choosePaymentScheme" id="installmentCheck" value="Installment" > Installment &nbsp&nbsp&nbsp';
        echo '<input type="radio" onclick="javascript:payment();" name="choosePaymentScheme" id="fullCheck" value="Full" checked> Full';
      }
      ?>
    </div>
  </div> 
  <div id="installment" style="display:none">
    <div class="form-group">
      <input type="text" name="Install" >
    </div>
  </div>
  <div id="full" style="display:none">
    <div class="form-group">
      <input type="text" name="full" >
    </div>
  </div>
</div>



via Chebli Mohamed

mardi 13 juin 2017

The number of people who connected all 6 zones in an event

I've developed an app for event. In the event there are 6 different zones and attendees can connect each other from each of the zone from the app.

My sample db table data is in below :

enter image description here

I am trying to get all the people who are connected in all the 6 zones.

I am struggling to write the mysql query for this.

Can you advise any approach with sample query code?



via Chebli Mohamed

vendredi 9 juin 2017

store error when insert the values in laravel 5.1

I have a problem when i use the function store whit larave

$id = DB::select("SELECT TOP 1 Id_ReqCambIng FROM cambio_ings ORDER BY 1 DESC")[0];

  $archivos = json_decode($request->archivos_subidos);
   foreach ($archivos as $archivo) {        
    if($archivo->status == "upload successful"){
      $archivo->name;
      $archivo->uuid;

      $ArchivosCamb = new ArchivosCamb();
      $ArchivosCamb->id_cambioIng=$id;
      $ArchivosCamb->NombreArchivo=$archivo->name;
      $ArchivosCamb->linkArchivo=$archivo->uuid;           
    $ArchivosCamb->save();

I get this error "Object of class stdClass could not be converted to string"



via Chebli Mohamed

jeudi 8 juin 2017

Create a query scope with two databases within the same scope in Laravel

I am trying to create a query scope with one table from the first database and attaching a left join to another table from another database. I understand cleary how to do a query scope in Laravel.

Is it possible to left join 2 tables from different databases? If so, how do you do it?

Here is my query scope:

public function scopeLinkSalesHistory($query, $search)
{
    $query->leftJoin('sOeinvd', 'inventory.item', '=', 'sOeinvd.item')
          ->leftJoin('sOeinvh', 'sOeinvh.invuniq', '=', 'sageOeinvd.invuniq');

    ! ( empty( $search ) ) ? $query->where( function ( $query ) use ( $search ) {
        $query->where( 'inventory.item', 'LIKE', '%' . $search . '%' )
              ->orWhere( 'inventory.description', 'LIKE', '%' . $search . '%' );
    } )
        : $query;

    $query->select('*', DB::raw('sum(qtyshipped) as qtysold'), 'inventory.item as item');
    $query->groupBy('sOeinvh.invfiscper')->groupBy('sOeinvh.invfiscyr')->groupBy('inventory.item')->orderBy('inventory.item')->orderBy('sOeinvh.invfiscyr')->orderBy('sOeinvh.invfiscper');
    return $query;
}

The tables that start with 's' are from the second database. It doesn't work because I am not referencing these tables properly. Normally I would use this:

DB::connection('sql')->table('sOeinvd')

But how do you use this in a query scope?



via Chebli Mohamed

Route with controller action always throwing syntax error during Laravel Packages development

I am new in laravel package development.Just trying to develop a simple package following the below tutorial:

http://ift.tt/2lCvNtE

Everything is going well but some problem is arising when trying to add route with controller. Follownig route is working well .

Route::get('calculator', function(){
    echo 'Hello from the calculator package!';
}); 

But,the Routes given below is throwing " `

syntax error, unexpected 'Route' (T_STRING)" error.

`

Route::get('add/{a}/{b}', 'Devdojo\Calculator\CalculatorController@add');
Route::get('subtract/{a}/{b}', 'Devdojo\Calculator\CalculatorController@subtract');

Please anybody help me. Sorry for my weak English. Thanks in advance.



via Chebli Mohamed

Laravel 5.1 - Purge Jobs programmatically

I'm new to Laravel Queues, I have a task which I need to purge a job in the queue programmatically. Is there a way to implement it?



via Chebli Mohamed

"message": "Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authoriz LARAVEL

i got this error when i try to test method in my controller

 GuzzleHttp\Exception\ClientException: Client error: `POST http://ift.tt/2sWwkqv` resulted in a `400 BAD REQUEST` response:
{
  "message": "Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authoriz (truncated...)



via Chebli Mohamed

mardi 6 juin 2017

Authentication with both email and username (same field) (laravel API )

I am building laravel API of my website . I am using laravel 5.3

I am using the API in building mobile app .

In login section, there are two fields :

  1. Enter email or username
  2. Enter password

In my DB , email and username are different columns.

Here is the function:

public function authenticate()
{

$credentials=request()->only('username','password');

try {

    $token=JWTAuth::attempt($credentials);

    if(!$token){
        return response()->json(['error'=>'credentials wrong'],401);
    }
}
catch(JWTException $e) {

 return response()->json(['error'=>'something_went_wrong'],500);

}
return response()->json(['token'=>$token],200);
}

Here only username is used,I want to use both username and password.

If need any other info please ask.

ty:)



via Chebli Mohamed

Laravel - Read object property

I have the following query in laravel 5.1.

   $dataName = App\Category::with('categoryLang', 'categoryLang.seo')->find($id);

   echo "<pre>"; print_r($dataName); echo "</pre>";  return;


that returns the following object App\Category

App\Category Object
(
    [table:protected] => category
    [connection:protected] => 
    [primaryKey:protected] => id
    [perPage:protected] => 15
    [incrementing] => 1
    [timestamps] => 1
    [attributes:protected] => Array
        (
            [id] => 60
            [ordine] => 100
            [hot] => 0
            [active] => 0
            [file] => 
            [parent_id] => 0
            [sizechart] => 0
            [created_at] => 2017-06-06 19:18:49
            [updated_at] => 2017-06-06 19:18:49
        )

    [original:protected] => Array
        (
            [id] => 60
            [ordine] => 100
            [hot] => 0
            [active] => 0
            [file] => 
            [parent_id] => 0
            [sizechart] => 0
            [created_at] => 2017-06-06 19:18:49
            [updated_at] => 2017-06-06 19:18:49
        )

    [relations:protected] => Array
        (
            [categoryLang] => Illuminate\Database\Eloquent\Collection Object
                (
                    [items:protected] => Array
                        (
                            [0] => App\CategoryLng Object
                                (
                                    [table:protected] => category_lng
                                    [connection:protected] => 
                                    [primaryKey:protected] => id
                                    [perPage:protected] => 15
                                    [incrementing] => 1
                                    [timestamps] => 1
                                    [attributes:protected] => Array
                                        (
                                            [id] => 121
                                            [category] => ciao
                                            [slug] => 
                                            [lang] => it
                                            [category_id] => 60
                                            [created_at] => 2017-06-06 19:18:49
                                            [updated_at] => 2017-06-06 19:18:49
                                        )

                                    [original:protected] => Array
                                        (
                                            [id] => 121
                                            [category] => ciao
                                            [slug] => 
                                            [lang] => it
                                            [category_id] => 60
                                            [created_at] => 2017-06-06 19:18:49
                                            [updated_at] => 2017-06-06 19:18:49
                                        )

                                    [relations:protected] => Array
                                        (
                                            [seo] => App\Seo Object
                                                (
                                                    [table:protected] => seo
                                                    [connection:protected] => 
                                                    [primaryKey:protected] => id
                                                    [perPage:protected] => 15
                                                    [incrementing] => 1
                                                    [timestamps] => 1
                                                    [attributes:protected] => Array
                                                        (
                                                            [id] => 1125
                                                            [title] => asdasdasdas
                                                            [description] => asdasdasdasd
                                                            [keywords] => asdasdasdasd
                                                            [seoble_type] => App\CategoryLng
                                                            [seoble_id] => 121
                                                            [created_at] => 2017-06-06 19:18:57
                                                            [updated_at] => 2017-06-06 19:18:57
                                                        )

                                                    [original:protected] => Array
                                                        (
                                                            [id] => 1125
                                                            [title] => asdasdasdas
                                                            [description] => asdasdasdasd
                                                            [keywords] => asdasdasdasd
                                                            [seoble_type] => App\CategoryLng
                                                            [seoble_id] => 121
                                                            [created_at] => 2017-06-06 19:18:57
                                                            [updated_at] => 2017-06-06 19:18:57
                                                        )

                                                    [relations:protected] => Array
                                                        (
                                                        )

                                                    [hidden:protected] => Array
                                                        (
                                                        )

                                                    [visible:protected] => Array
                                                        (
                                                        )

                                                    [appends:protected] => Array
                                                        (
                                                        )

                                                    [fillable:protected] => Array
                                                        (
                                                        )

                                                    [guarded:protected] => Array
                                                        (
                                                            [0] => *
                                                        )

                                                    [dates:protected] => Array
                                                        (
                                                        )

                                                    [dateFormat:protected] => 
                                                    [casts:protected] => Array
                                                        (
                                                        )

                                                    [touches:protected] => Array
                                                        (
                                                        )

                                                    [observables:protected] => Array
                                                        (
                                                        )

                                                    [with:protected] => Array
                                                        (
                                                        )

                                                    [morphClass:protected] => 
                                                    [exists] => 1
                                                    [wasRecentlyCreated] => 
                                                )

                                        )

                                    [hidden:protected] => Array
                                        (
                                        )

                                    [visible:protected] => Array
                                        (
                                        )

                                    [appends:protected] => Array
                                        (
                                        )

                                    [fillable:protected] => Array
                                        (
                                        )

                                    [guarded:protected] => Array
                                        (
                                            [0] => *
                                        )

                                    [dates:protected] => Array
                                        (
                                        )

                                    [dateFormat:protected] => 
                                    [casts:protected] => Array
                                        (
                                        )

                                    [touches:protected] => Array
                                        (
                                        )

                                    [observables:protected] => Array
                                        (
                                        )

                                    [with:protected] => Array
                                        (
                                        )

                                    [morphClass:protected] => 
                                    [exists] => 1
                                    [wasRecentlyCreated] => 
                                )

                        )

                )

        )

    [hidden:protected] => Array
        (
        )

    [visible:protected] => Array
        (
        )

    [appends:protected] => Array
        (
        )

    [fillable:protected] => Array
        (
        )

    [guarded:protected] => Array
        (
            [0] => *
        )

    [dates:protected] => Array
        (
        )

    [dateFormat:protected] => 
    [casts:protected] => Array
        (
        )

    [touches:protected] => Array
        (
        )

    [observables:protected] => Array
        (
        )

    [with:protected] => Array
        (
        )

    [morphClass:protected] => 
    [exists] => 1
    [wasRecentlyCreated] => 
)

How can I read the values of the sub-object App\Seo without having to run across the entire object? I'm sure there is another way but I'm a very beginner with laravel.



via Chebli Mohamed

lundi 5 juin 2017

why I am getting TokenMismatchException in VerifyCsrfToken.php line 53 in laravel 5.1 while i am using csrf token

I am suffering this problem that says TokenMismatchException in VerifyCsrfToken.php line 53: I am using {!!Form::open()!!} {!!Form::close!!}. When I click add Button in my form with empty field for first time it shows me error as I set validation rule. But when I click Add button again without refreshing the page it shows me TokenMismatchException error. I have checked with dd() and it shows me the token like this:

 `array:3 [▼
 "_token" => "5dXwRHbz4GNY1tx9OVeWPcOkirVIm0YtpkZufFbr"
 "menu_name" => ""
 "menu_price" => ""`

here is my form code

{!! Form::open(array('route' =>'upcoming.store', 'method'=>'POST')) !!}
                    <div class="col-lg-6 col-sm-offset-3 top-spacing">
                        <input type="text" name="menu_name" placeholder="Menu Name.." class="form-control">
                    </div>
                    <div class="col-lg-6 col-sm-offset-3 top-spacing">
                        <input type="text" name="menu_price" placeholder="Menu Price.." class="form-control">
                    </div>

                    <div class="col-sm-2 col-sm-offset-8 top-spacing">
                        <button class="btn btn-success">
                            Add +
                        </button>
                    </div>

                </div>
                {!! Form::close() !!}`

Here is my controller store function

 public function store(Request $request)
{
    dd($request->all());
    $this->validate($request, array(
        'menu_name'=>'required',
        'menu_price'=>'required',
        ));
    $upcoming = new Upcomingfood;
    $upcoming->menu_name=$request->menu_name;
    $upcoming->menu_price=$request->menu_price;
    $upcoming->save();
    Session::flash('success','Food Menu Added Successfullly');
    return redirect()->back();

}

thanks in advance. It will be really helpful for me if I get my answer as I am new in Laravel.



via Chebli Mohamed

how to use traits in laravel models

Hello i'm laravel beginner

I want to make trait and use it in my model but at run time i got error that the trait is not found

my trait :

namespace App;

use Illuminate\Support\Facades\Schema;

trait GeneralModel { public static function testStaticFunction() { dd('test'); } }

my model :

namespace App;
use Illuminate\Database\Eloquent\Model;

class Comment extends Model { use GeneralModel;

}

my controller

namespace App\Http\Controllers;

use App\Comment;

class SearchController extends Controller { public function find(){ Comment::testStaticFunction(); }

}

error received

Trait 'App\GeneralModel' not found



via Chebli Mohamed

How to remove multiple filed laravel?

I have my table data:

id  song_id   playlist_id
1     2          5
2     2          4

I want to remove it by if I give

song_id playlist_id
2          4         success
2          3          fail 

Please help me thanks Noted: I use laravel custom query builder



via Chebli Mohamed

heroku app web constantly firing warning run id unauthorised

I have an application deployed over heroku where I have paid for hobby dyno plan and a paid postgres instance.

My heroku pipeline is also completely set up where I have multiple apps running different versions of the application

The problem only rises in the paid app as below-

2017-06-05T11:00:24.816860+00:00 app[web.1]: 2017/06/05 11:00:24.816756 
(7) Warning: app "my-app-name" with run id "21****3840926*****" 
received unauthorized

On reporting this to heroku The only reply i have recived is that it's a problem with the application. By I am wondering if it's an application error why will it appear in only one instance and not in any other environment.

Also what I am not able to understand is what exactly it means by run id

Any help for the right direction will be great.



via Chebli Mohamed

How to hide .env file in production + laravel?

I have create porject in laravel and host it on server.

  • But when i type .env after my domain it show all my details of .env file

Eg. www.example.com/.env

  • it will show .env file in browser.


via Chebli Mohamed

vendredi 2 juin 2017

¿Query in laravel with Relationships from blade?

i have the following tables

  • Users
  • request
  • servers

Which are related in the following way.

  • User has many request
  • Sever has many request

Now what I want is to get all the servers associated with the requests that the user has without repetitions.

I have to do it in the blade view since in the view I am iterating the services and showing them in a table.

So far I've been trying the following

@foreach($requests as $request)    
@php


    $serversUser = \App\Server::where('requestsofservice', function($query){
                                                        $query->where('user_id',$request->user->id);
                                                    });
                                                @endphp
@endforeach

But it doesn't work be caouse the var $request->user->id .

and the result is Undefined variable: request

So, how could i get the services that the user a has related to their request without repetitions.



via Chebli Mohamed

Multiple where conditions in Laravel 5.1

i have a problem in my multiple filters implementation. I have some checkboxes that pass to AJAX some params that can have multiple values. In my controller i have written this to handle this params:

function getCategoria(Request $request) {
    $path_info = Request::getPathInfo();
    $path = substr($path_info, 1);
    $links = explode('/', $path);
    $categorie = \App\Models\Categorie::where('primaria',1)->get();
    $categoria = \App\Models\Categorie::where('link_statico', $path)->first(); 
    $categoriaz = \App\Models\Categorie::where('link_statico', $path)->first(); 
    $id = ucfirst($links[0]);

    $prodottip = \App\Models\Prdotticategorie::where('prodotti2categorie.id_categoria', $categoriaz->id)->join('prodotti', 'prodotti.id', '=', 'prodotti2categorie.id_prodotto')->query();

    $brands = Input::get('brands');
    $genere = Input::get('genere');
    $stagione = Input::get('stagione');
    $this->data['links'] =  $links;
    $this->data['categorie'] =  $categorie;
    $this->data['categoria'] = $categoria;  
    $this->data['categoriaz'] = $categoriaz;
    $this->data['id'] = $id;
    $this->data['pages'] = 'categorie.frontend';
    if(count($brands) > 0 && count($genere) > 0 && count($stagione) > 0) 
    {
        if(count($brands) > 0)
        {
            $brands_array = [];
                if(is_array($brands) || is_object($brands)) 
                {
                    foreach ($brands as $brand) 
                    {
                        $brands_array[] = $brand;
                    }
                        $rst = $prodottip->whereIn('prodotti.id_produttore', $brands_array);
                }
        } 
        if(count($genere) > 0)  
        {
            $genere_array = [];
                if(is_array($genere) || is_object($genere)) 
                {
                    foreach ($genere as $gen) 
                    {
                        $genere_array[] = $gen;
                    }
                        $rst = $prodottip->whereIn('prodotti.genere', $genere_array);
                }
        } 
        if (count($stagione) > 0) 
        {
            $stagione_array = [];
                if(is_array($stagione) || is_object($stagione)) 
                {
                    foreach ($stagione as $stag) 
                    {
                        $stagione_array[] = $gen;
                    }
                        $rst = $prodottip->whereIn('prodotti.stagione', $stagione_array);
                }
        }
        $prodottix = $rst->paginate(18);
    } else {
        $prodottix = $prodottip->paginate(18);

    }
    $this->data['prodottix'] = $prodottix;
    if (Request::ajax()) {
        $page = 'layouts.'.CNF_THEME.'.categorie_ajax';
        $view = view($page, $this->data)->render();
        return response()->json(['html'=>$view]);

    }
    $page = 'layouts.'.CNF_THEME.'.categorie';
    return view($page, $this->data);
}

The problem is that AJAX reload correctly but the results remaining the same. I can bring it working only if i an elseif with different scenarios like this:

if(count($brands) > 0 && count($genere) > 0 && count($stagione) > 0)
   //query with 3 where 
elseif(count($brands) > 0 && count($genere) == 0 && count($stagione) == 0)
  // query with 1 where

Hi have read something on DynamicScopes in Laravel, but i need more help thks



via Chebli Mohamed

jeudi 1 juin 2017

Dynamic Ajax filter with Laravel implementation

i'm tryng to create a sidebar filters for an e-commerce. I have successfully implemented a infinte scroll pagination, but now i have a problem with filters.

    <ul class="check-box-list">
      <?php $m = 1; ?>
        @foreach($marchi as $marchio)
          <li>
           <input type="checkbox" id="m" class="marchio" name="" data-marchio="" value="" />
          <label for="m">
            <span class="button"></span>
               <span class="count">()</span>
            </label>   
     </li>
 <?php $m++; ?>
     @endforeach   
 </ul>

have this above checkboxes that is generated dynamically. If i click on one of this i can trigger the correct value using this js:

<script type="text/javascript">
$('.marchio').on('click', function() {
      var marchio = $('.marchio:checked').val();
      $.ajax(
        {
            url: '?marchio=' + marchio,
            type: "get",
            beforeSend: function()
            {
                $('.ajax-load').show();
            }
        })
        .done(function(data)
        {
            if(data.html == " "){
                $('.ajax-load').html("No more records found");
                return;
            }
            $('.ajax-load').hide();
            $("#post-data").append(data.html);
        })
        .fail(function(jqXHR, ajaxOptions, thrownError)
        {
              alert('server not responding...');
        });
});

But if i click a 2nd checkbox, the value appended to the ajax url remaining the same, if i uncheck the first remaining the second. I need to pass to the url multiple values of the same checkbox class by appending it to the url. And if some categorie's can have multiple filter's i need the ajax url can accept different ?querystryngs for example by appending ',' separated values once we click on checkboxes. Can someone help me?



via Chebli Mohamed