Questions tagged as 'laravel'

2
answers

Laravel 5.4: Error creating table - unexpected '(', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'

When you run the php artisan migrate command to create the table in the database, the following error appears: [Symfony\Component\Debug\Exception\FatalThrowableError] Parse error: syntax error, unexpected '(', expecting identifier (T_STRIN...
asked by 05.07.2017 / 15:21
1
answer

Laravel / Eloquent: How to create a primary key composed of two foreign keys?

I am creating a simple system for school management and I will have a table named 'student_class', where the primary key must be composed of the student id and class id, which are foreign keys of the 'student' and 'class' tables respectively . I...
asked by 06.08.2017 / 19:11
2
answers

Results by user id logged in

I have a users table with primary_key id and I have a people table with a user field I want to understand how to use the laravel relationship for these tables and I want to fetch the person with the userid in the user field How can I do...
asked by 29.05.2017 / 23:43
1
answer

How do I make the checkbox 'checked' after saving in the bank?

My checkbox are saving normally, however, when I leave the page and return, they are not checked. Clients.blade.php<body><formmethod="POST" action="/user/update/client"> <input type="hidden" name="id" value="{{...
asked by 30.03.2017 / 14:54
1
answer

How to create search filters in Laravel?

I need to create a search system that receives data through Inputs, select and checkbox. My form to search: <form class="navbar-form navbar-left" role="search" action="{!! url('/pesquisar') !!}" method="post" style="margin-left: 25%;marg...
asked by 22.03.2017 / 15:02
1
answer

How to create entities with compound key in doctrine?

I have a database that works with composite keys, and I'm implementing the use of the Laravel framework . This is my bank structure: I'm using doctrine as an ORM and found that I can not automatically generate the entities of the datab...
asked by 05.04.2017 / 16:19
1
answer

How do I know where the route came from and redirect back?

I have 3 tables in BD : Emitentes, Pessoas e Cidades . Being that in the Issuers table and in the People table I have FK id_cidade . When I am registering one, both Emitente and Pessoa have in the views a li...
asked by 03.04.2017 / 15:05
1
answer

Error message through middleware Laravel

I'm trying to pass an error msg through a middleware. If you use $ errors-> all () the error appears, but how do you use $ errors-> has ('active')? Or would it be easier to pass this middleware message? Another question is how to customize the e...
asked by 13.05.2017 / 18:10
2
answers

Laravel Insert data into one table and use the same id to fill in another

I'm starting in Laravel and I'm having a problem with inserting data into two mysql tables ... explaining better would be: I have a table called questionnaires where I have only ID and Description and another table called statements where I have...
asked by 21.02.2017 / 19:14
1
answer

Authentication does not work after executing the make: auth command

I run the command: SmartFlex> php artisan migrate within my project and it is finalized correctly. The login and registry options are available in view , but when trying to access the registry, for example, the following error occur...
asked by 27.05.2017 / 03:27