Questions tagged as 'laravel-5'

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 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

Save relationship 1: 1 in Laravel 5.3

In my scenario, I have the tables of users and teachers, where a teacher has a user, so I have a 1:1 relation. Migrations: create_users_table Schema::create('users', function (Blueprint $table) { $table->increments('id'...
asked by 07.01.2017 / 01:33
1
answer

How to access the public directory of Storage in Laravel 5.3?

I need to access saved images in the /storage/app/public directory on views , but I can not, I have a 404 . I'm doing the following: <div class="row"> <img src="../storage/app/public/3.jpg"> </div>...
asked by 16.12.2016 / 13:03
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
2
answers

Problem accessing a One to Many relationship in Laravel

My Product model has the following relationship: public function categoria(){ return $this->belongsTo('estoque\Categoria'); } and my model Category has: public function produtos(){ return $this->hasMany('estoque\Produto'...
asked by 24.10.2015 / 17:04
1
answer

Project Laravel does not recognize my Javascript file

This is the structure of my project: Asyoucanseeintheimageabovetheapp.jsfileisintheassets/jsfolderMyapp.jsfilelookslikethis;//varurlUsers='https://randomuser.me/api/?results=10';varurlUsers='https://jsonplaceholder.typicode.com/users';newVue...
asked by 10.10.2017 / 11:57
1
answer

Download File via API + Lumen + Maatwebsite \ Excel

I have an Angular application 5 that makes a request to the backend made in Lumen 5.6, in this backend, I have a function that creates an excel file, with the Maatwebsite \ Excel library, for download. However I am not able to download the file...
asked by 13.07.2018 / 12:03
2
answers

Incompatibility between Blade and Angular JS in Laravel 5

I'm having trouble using AngularJS along with Laravel's Blade. After searching this site myself, I discovered that to resolve the conflict with Laravel the most recent method is using @{{}} in variable calls. The page is loaded, a...
asked by 10.01.2017 / 19:57