mardi 29 mars 2016

Lravel 5.0 - (This site can’t be reached The connection was reset)

I receive the following error message in "some" of my laravel webpages project:

This site can’t be reached The connection was reset. ERR_CONNECTION_RESET

Any advise please



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/25tG4Hm
via IFTTT

Laravel 5 redirect to controller actions

If I want to redirect to a controller's action. Must this controller action be registered in routes.php ?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/22WGe87
via IFTTT

lundi 28 mars 2016

How to get value from column that was changed by trigger

Im having a problem. I have a before insert trigger (MySQL) on a table that changes the value of a column. But after doing the ->save() that the triggers its supposed to be done, if I do object->number (number is the column that was set on the trigger) I get nothing, while if I look on the database number was set.

I dont know why it happens if the autoincrement id is also set during the insert and that one I can get it.

Thanks for the help



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1qc7txv
via IFTTT

Laravel 5 update without id

I have a problem in Laravel 5. When I update a record in database, I get error Unknown column 'id' in 'where clause'. In the controller, I use WHERE clause to get the record I want to update. My primary key is not id and the type is bigInteger. I've tried adding protected $primaryKey in the model but it doesn't work for bigInteger. Is there any way to use my own primary key instead of using id?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1RBSgPf
via IFTTT

Laravel Eager Loading Not Working

I have the following in my index controller:

    $recipes = Recipe::with(['color', 'glass', 'garnishes', 'recipeLines.fraction','recipeLines.unitOfMeasure','recipeLines.brand','recipeLines.product','recipeLines.ingredient', 'method', 'howServed', 'equipment', 'uom', 'products'])->where('location', $this->getLocation())
        ->whereBetween('updat', array($this->getListFromDate(), $this->getListToDate()))
        ->paginate($this->getItemsPerPage());

I thought that by using with() that Laravel would change my model relationships from individual selects to joins when Recipe::all() is called but when I look at DB::connection('remoteRecipes')->getQueryLog() I see 50 select queries instead of one.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1PBvyCj
via IFTTT

How to authenticate without database in Laravel 5.2?

I have tried the following code to authenticate in Laravel 5.2. But I don't know how to make login true. I tried Auth::login(true) after if statement but it is not working properly. I have found some articles about this topic but i couldn't find a detailed example.

public static function Login($email,$password)
{
    $fp = fsockopen ( "www.mydomain.com" , 110 );
    if (!$fp) {
        return "Bağlantı Hatası";
    }
    $trash = fgets ( $fp, 128 );
    fwrite ( $fp, "USER ".$email."\r\n" );
    $trash = fgets ( $fp, 128 );
    fwrite ( $fp, "PASS ".$password."\r\n" );
    $result = fgets ( $fp, 128 );
    if(substr ( $result, 0, 3 ) == '+OK')
        return true; //user will be logged in and then redirect
    else
        return false;
}

If it is possible, could you please add a code here that how to make auth true?

P.S. I can retrieve the user information using email with a simple query after login.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1MNyvje
via IFTTT

Running phpunit as a Laravel 5 Queued Job, endless processed loop

I'm trying to automate some of my phpunit testing with a Laravel 5 Queues Job using Process in Symfony (and exec and a few other methods).

I am able to execute phpunit just fine but doing so throws the Queue into an infinite loop of:

[2016-03-28 18:04:58] Processed: Illuminate\Queue\CallQueuedHandler@call
[2016-03-28 18:04:59] Processed: Illuminate\Queue\CallQueuedHandler@call
[2016-03-28 18:04:59] Processed: Illuminate\Queue\CallQueuedHandler@call
[2016-03-28 18:04:59] Processed: Illuminate\Queue\CallQueuedHandler@call
[2016-03-28 18:05:00] Processed: Illuminate\Queue\CallQueuedHandler@call

I've tried several ways to execute phpunit, all seem to cause this issue. Doing a Process on a ls -al or whoami work just fine.

Any help would be appreciated.

namespace App\Jobs;

use App\Jobs\Job;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Symfony\Component\Process\Process;


class ProcessPHPUnit extends Job implements ShouldQueue
{
    use InteractsWithQueue, SerializesModels;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct()
    {
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {

      $process = new Process('vendor/bin/phpunit', base_path());
      $process->run();

    }

}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/21PsnOo
via IFTTT