Questions tagged as 'laravel'

1
answer

Required_if with more than one field in Laravel 5.3

I have the following situation: I want a field to be mandatory only if the other two are null , if one of the other two is not null this field is no longer mandatory. I thought about using required_if , but I believe that i...
asked by 05.02.2017 / 19:17
1
answer

Error using POST in Laravel API

I'm learning how to build an API using Laravel 5.4. *. No Api.php : $this->get('products', 'API\ProductController@index', ['except' => [ 'create', 'edit' ]]); No Product.php : class Product extends Model { pro...
asked by 13.10.2017 / 21:00
1
answer

Extension of function in laravel

I'm using Laravel 5.3 and apparently I have a Controller calling the function: (new AnuncioRepository())->getListagemAnuncios() and the SQL for this is: return DB::select(' SELECT anuncio.id,...
asked by 04.01.2017 / 13:44
1
answer

How do I check credentials before logging in to Laravel 5.3?

My application uses Laravel's ready authentication, however I'm requiring users to log in to it from a webservice. So what I'm trying to do is that if the guy exists in the application database, he does Laravel's native authentication, if not...
asked by 11.01.2017 / 21:19
1
answer

How to validate at least one required field?

I have two fields CPF and CNPJ, the user must enter only one, but never leave both fields empty. This way it leaves the two fields mandatory: [ 'Cpf' => array('required'), 'Cnpj' => array('required'), ] Is there any way in Lar...
asked by 12.01.2017 / 14:14
1
answer

How to make a composer package available? [duplicate]

The json below is part of the composer.json file of a package I created: { "name": "libspkgs/utils", "type": "library", "description": "Descrição aqui.", "keywords": ["key1", "key2"], "homepage": "https://endereco.com",...
asked by 15.11.2016 / 02:22
2
answers

How to see the queries that were executed by eloquent in Laravel?

How can I find out which queries have been executed in Laravel? For example, I have the following query: $usuarios = Usuario::with('nivel')->where(['status' => 1])->get(); I would like to know which queries were executed. Can yo...
asked by 24.08.2016 / 15:09
1
answer

How does Laravel read the ".env" file?

How does Laravel read the .env file? I have already looked at the repositories of Illuminate (from Laravel) and found nothing that would give me a hint as to how to read this file. Is there a library, which Laravel uses, that does t...
asked by 30.09.2016 / 19:12
2
answers

How to use echo in a Laravel view?

I want my layout blade echo only if the $errors variable is set: @section('mensagens') <div class="container"> <div class="row"> <div class="col-md-2"></div> {{...
asked by 01.11.2016 / 14:17
2
answers

Make a custom validation in laravel 5

I have a system in laravel 5. I have a Form Request validating the fields of a form with some rules. And I needed to do the following: I have a tab on the form that registers the members of a company. The user has the option to register or no...
asked by 10.10.2016 / 20:26