Questions tagged as 'laravel'

1
answer

Do a HasMany by date with Laravel 5.3?

Is there any way to do HasMany by bringing records by date? public function despesas() { return $this->hasMany(Despesa::class); //registros apenas desse mês } I tried to use the following but did not scroll: public functio...
asked by 22.11.2016 / 11:38
1
answer

How to use Facades of Laravel outside its structure?

I'm trying to use some "laravel framework" classes in other files, but I'm not getting any success. For example: I created a public/teste.php file with the following code: require __DIR__.'/../bootstrap/autoload.php'; use Illuminate...
asked by 24.05.2016 / 03:57
1
answer

Field code in the value attribute of the option

I have a CategoriaCNH table with the following fields CodCategoriaCNH and Descricao . I have this code snippet html : <select name="categoriaCnh"> <option value="" disabled selected>CNH</option&g...
asked by 24.05.2016 / 03:53
2
answers

Laravel installation error

Folks, I'm using Mac and trying to install Laravel. I already installed composer , I ran the command line documented in the framework: composer global require "laravel/installer=~1.1" It does everything ok, but when I try laravel ne...
asked by 13.11.2015 / 03:14
1
answer

Pass a JSON from the view to the route

I'm trying to send JSON of view to a route, but I can not. Unfortunately I know little about JSON , ajax , GET and POST . In the view, json: var json = { "numeroMesa": numeroMesa, "itens": itens }...
asked by 03.02.2016 / 16:53
1
answer

Check which field already exists in the table

I am making a query in Laravel to see if the user with the email, CPF or username entered already exists in the database. # Verificar se Usuário Já Existe na Base de Dados $verUser = User::whereEmail($email) ->...
asked by 18.03.2016 / 13:21
1
answer

How does Laravel 5 do so that an instance is passed automatically if we only define the Type Hinting in the parameter in a function?

I think this is a totally valid curiosity, as it greatly facilitates and speeds development. I often analyze the framework code I usually use, such as Cakephp 2 , Laravel 4 and Symfony 2 . I started working shortly with...
asked by 02.03.2016 / 12:52
1
answer

Run a Laravel Schedule every minute?

I'm using Laravel 5.3 and would like to run a task every minute, within the task I'll put some checks, the question is to make it run every minute. I did the following in App \ Kernel: protected function schedule(Schedule $schedule...
asked by 23.11.2016 / 18:07
1
answer

Pagination hasMany Laravel 5.1

I have the following relationship in my Model Client: public function Usuario(){ return $this->hasMany('SIST\Models\Admin\Usuario', 'id_cliente'); } I pass the client data by my Controller : $cliente = Cliente::find($...
asked by 22.01.2016 / 14:31
1
answer

How to validate the login without redirecting the page?

I have the following login form in a dropdown, my question is, how to do login validation without redirecting the page? Currently when the user informs a wrong password it is redirected to the login page and informs the error message. <...
asked by 11.03.2016 / 23:35