Questions tagged as 'laravel-5'

1
answer

ORDERBY, ignore accents

I have a name column that belongs to the Producer_BVU model, whose names are: 2M1J A. Coelho ÓRBITA Bruno When I order: \App\Producer_BVU::orderBy('name', 'ASC')->get(); The output is: ÓRBITA 2M1J A. Coelho Bruno...
asked by 04.01.2018 / 10:50
1
answer

Invalid handle returned - Laravel connection with SQL Server

I was developing an application with Laravel 5.5 with a Mysql database. Everything was working normally, however, now the database has been modified to SQL Server. When I run the test, it returns the error "Invalid handle returned." Searc...
asked by 21.09.2017 / 15:35
1
answer

Validation in Laravel

I'm using Form Request Validation to validate a form, but when I leave a field of type required blank no error is generated. How do I generate an error when validation fails? class SaleRequest extends FormRequest { public f...
asked by 12.08.2017 / 03:03
1
answer

Problem with search and pagination in Laravel?

The code below returns all the records of the database and also searches for the term typed in input of search with pagination. The problem is that by clicking for example on page 2 it already refreshes the page returning all the recor...
asked by 25.05.2017 / 22:50
1
answer

Doubt Laravel SQL Queries?

I'm starting with SQL of Laravel I looked a lot more I did not get a response of how to AND after where , follow sample code to implement AND . SQL: UPDATE contas SET valor_titulo = 0, WHERE id_contrato = 2...
asked by 22.03.2017 / 20:41
1
answer

How to change the default name of an eloquent column

I'm in a project that is in production, and by default when we use a foreign key in eloquent we follow the following rule "user_id" for example to store the user id. Only in the database that I'm working with, they put this field as " id_u...
asked by 20.06.2017 / 14:01
1
answer

Check route with variable in Laravel 5.1

I'm using the code below to assign the "active" class when on the "product" or "product / create" route. <li {!! Request::is('produto', 'produto/create')? 'class="active"' : null !!}> Now I need to do the same in the product edition,...
asked by 08.05.2017 / 16:29
1
answer

LEFT JOIN with AND at Eloquent Laravel 5

I have a query with Left Join with AND I am not able to implement this in laravel 5. An excerpt from the query: LEFT JOIN visitante v ON a.codigo = v.id AND v.data BETWEEN '2015-06-01' and '2016-05-31' and v.status = '1' I tried this wa...
asked by 25.11.2016 / 15:38
1
answer

Improve bank insertion of related entities?

I have the database User , Professional and Address in the database. The foreign key for User is in Professional and the foreign key for Professional is in Address . I need to register a professional, who is a user and has an address...
asked by 04.10.2016 / 21:43
1
answer

Object of class Illuminate \ Database \ Eloquent \ Builder could not be converted to string. laravel 5.2

I'm having trouble with a relative search on Laravel . I give the option of several on-screen search, they are: start date end date status, and who it is But the person can search in a unitary way, for example: I want to get e...
asked by 16.11.2016 / 22:00