Questions tagged as 'laravel-5'

1
answer

How do I install doctrine / dbal in laravel 5.3?

I try to install it by editing my file composer.json in the following way: "require": { "laravel/framework": "5.3.*", "doctrine/dbal": "v2.4.5" }, And then executing the composer update command. But this throws me th...
asked by 07.04.2017 / 00:19
2
answers

Make a correct query of two tables

I'm having a problem with a query in Laravel where two tables are related: Empleados and Emergencias in a 1: N relationship. According to me, I have good relationships in my models that are the following. Employee class...
asked by 10.03.2017 / 16:26
1
answer

How to validate a date between two columns in a db table? in Laravel

I'm trying this way: Turnos::whereBetween(DB::raw("'".$req->crear_hora_inicial2."'"), ['hora_inicio','hora_final']) ->orWhereBetween(DB::raw("'".$req->crear_hora_final2."'"), ['hora_inicio', 'hora_final']) ->exists()...
asked by 22.02.2017 / 08:43
1
answer

I get the error "PHP Fatal error: Call to a member function getKey () on string"

When executing via console php artisan db:seed I get the following error PHP Fatal error: Call to a member function getKey () on string The error occurs precisely with a function of the Seeder since with other functions it gave the exp...
asked by 17.02.2017 / 00:53
2
answers

How do I protect routes and functions of a controller with custom middleware in laravel 5.3?

I have% custom middleware for routes and for CRUD functions. The one with the routes works perfectly for me, but the one with the functions does not. Constructor of each controller, this ej is the one of Users: public function __...
asked by 09.01.2017 / 08:02
1
answer

Problem with Logout in Middleware Guest Laravel 5.3

I have the route as follows: Route::group(['middleware' => 'guest'], function() { Route::auth(); }); By clicking on logout, redirect me back to / home (as log in). On the other hand, if the Route :: auth (); I take it out of the m...
asked by 01.01.2017 / 19:25
1
answer

Number results of a query in Laravel and MySQL

I'm starting in Laravel and I need your help please. I want to number a column after making a query to the BD. If someone can help me, it would be great: My driver is as follows: $participantes = DB::table('participante') ->selec...
asked by 19.12.2016 / 18:58
2
answers

Why does not my "web page not found 404" in laravel 5.3 work for me?

I create a view and add it to the file app/Exception/Handler.php of the following way: public function render($request, Exception $e){ if ($this->isHttpException($e)){ return $this->renderHttpException($e); }else...
asked by 17.12.2016 / 19:43
1
answer

Error with routeing with namespace in Laravel 5.3

Good, I have the following problem ... I am using laravel 5.3 and I want to group the controllers by Namespaces to have ordered, but it does not work for me if I follow the laravel 5.3 document ... surely something I need to set somewhere. ro...
asked by 13.12.2016 / 12:34
1
answer

Queries of records in tables many to many with laravel

How would you do when checking the records of two related tables (many to many) using a pivot table of laravel? I try to do it with Joins, but I can not find what I want. The tables are: user role_user roles     
asked by 14.12.2016 / 16:39