vendredi 7 avril 2017

Datatables response 500 error internal server when return from multiple tables

i get this error when i use searchbox Datatables warning

i have join my tables with this query

$query = LoginQuarter::join('wholesalers','login_quarter.username','=','wholesalers.user_id') ->select('wholesalers.id as wholesaler_id','wholesalers.name as name', 'login_quarter.quarter','login_quarter.years', 'login_quarter.target', 'login_quarter.updated_at');

And this is the return function enter image description here

I will not get that error if i comment in line wholesaler_id (line 82) and name (line 83) but i need to display that.

This is my first post in this forum, i hope i will get more knowledge from your help. Thankyou.



via Chebli Mohamed

jeudi 6 avril 2017

Decode OpenID id_token - JWT

I have an id_token from OpenID Auth Server, when I test decode it on :

https://jwt.io/

I got

enter image description here

I'm wondering, if there a way to achive this decode programatically?

Is there a Laravel framework that will help me achieve that?



via Chebli Mohamed

Laravel 5.1 Job dispatches other jobs - how to manage and keep track?

Within one job I would like to dispatch and manage other smaller jobs. When the last child job has finished, I would like to notify the parent job that all were successful.

If for some reason the child job failed, then also notify the parent accordingly.

Currently the parent job finishes as the first child job is dispatched and therefore no longer has visibility of what happens next. Previously I didn't have child jobs and just executed the code within the single parent job however, these aren't insufficient tasks and can vary drastically in execution time so this wasn't a viable solution.

Am I missing something?



via Chebli Mohamed

lundi 3 avril 2017

ow to insert data into tables related to a single form?

Good. I would like help. I do not know how to insert data into tables related to a single form in laravel

This is my model User:

use Authenticatable, Authorizable, CanResetPassword;

/**
 * The database table used by the model.
 *
 * @var string
 */
protected $table = 'users';

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

public function credencials()
{
    return $this->hasOne('App\Credencial');
}

And this is the credential model:

protected $table = 'credencials';

protected $fillable = ['clave'];

public function users()
{
    return $this->hasOne('App\User');
}

What I do not know is how I keep the data in the related tables. help me please



via Chebli Mohamed

Selecting checkbox "All" to select all underlying checkboxes in javascript

I have a checkbox with JavaScript but if click checkall, the other checkboxes wont select.What am I missing here?Hope anyone could tell me what went wrong. I must be missing something with JavaScript but really I dont have any idea.I'd already done my research and the best resort to lane on is here.Hope someone could enlighten me here.

    function checkAll(checkname, bx) {
        for (i = checkname.length; i--; )
            checkname[i].checked = bx.checked;
    }
        


    function checkPage(bx){                    
        for (var tbls = document.getElementsByTagName("table"),i=tbls.length; i--; )
            for (var bxs=tbls[i].getElementsByTagName("input"),j=bxs.length; j--; )
               if (bxs[j].type=="checkbox")
                   bxs[j].checked = bx.checked;
    }
  <table border="1" name ="table">

    <tr>
        <td name ="list00">
            <label name ="list00">
                <input type="checkbox" name="Check_ctr" value="yes" onClick="checkAll(document.list00.link, this)"><b>Check All</b><dd>
                <input type="checkbox" name="link" value="something.com">something.com<dd>
                <input type="checkbox" name="link" value="something.com">something.com<dd>
            </label>
        </td>
        <td><label name ="list01">
                <input type="checkbox" name="Check_ctr" value="yes" onClick="checkAll(document.list01.link, this)"><b>Check All</b><dd>
                <input type="checkbox" name="link" value="something.com">something.com<dd>
                <input type="checkbox" name="link" value="something.com">something.com<dd>        
            </label></td>
    </tr>
    <tr>
        <td><label name ="list10">
                <input type="checkbox" name="Check_ctr" value="yes" onClick="checkAll(document.list10.link, this)"><b>Check All</b><dd>
                <input type="checkbox" name="link" value="something.com">something.com<dd>
                <input type="checkbox" name="link" value="something.com">something.com<dd>    
            </label></td>
        <td><label name ="list11">
                <input type="checkbox" name="Check_ctr" value="yes" onClick="checkAll(document.list11.link, this)"><b>Check All</b><dd>
                <input type="checkbox" name="link" value="something.com">something.com<dd>
                <input type="checkbox" name="link" value="something.com">something.com<dd>    
            </label></td>
    </tr>
    </table>


via Chebli Mohamed

dimanche 2 avril 2017

Laravel Payment Gateway

my website would be needing a payment gateway.

Stripe is not available in my country and want to use www.2checkout.com

i was planning to use this (http://ift.tt/2nyZcTc). but its under development and i think it might give me limited functions.

i plan on using the 2checkout library and using their documentation.

can someone tell me what is the clean/proper way on including the library on laravel?

thank you.



via Chebli Mohamed

SFTP Upload Laravel 5

I’m trying to upload files to my staging server running Linux Ubuntu.

I tried follow everything in this post = http://ift.tt/1XqtqE3 . I am on Laravel 5.1.

I configured my remote.php like this :

'connections' => [
        'production' => [
            'host'      => '45.55.88.88',
            'username'  => 'root',
            'password'  => '',
            'key'       => '/Users/bheng/.ssh/id_rsa', //Try : public | private
            'keytext'   => '',
            'keyphrase' => '******',
            'agent'     => '', //Try : empty | enabled | disabled,
            'timeout'   => 10,
        ],
    ],

I tried test it like this in my project :

SSH::run('date', function($line) {dd($line); });

I kept getting :

Unable to connect to remote server.


I tried it on my Mac OS Terminal

sftp root@45.55.88.88

It’s working fine, I got

sftp> ls
Desktop       Documents     Downloads     Music         Pictures      Public        Templates     Videos        dead.letter


What did I do wrong or forget ? What elses should I try ?

Do I need to do anything on my /etc/ssh/sshd_config ?

Can someone please help me out if you’re done this before ?



via Chebli Mohamed