Questions tagged as 'laravel-eloquent'

1
answer

Help with relationships in laravel

I'm really enjoying using laravel 5.4 and I have some questions about relationships and how best to use I have the tables evento -id -nome categorias_evento -id -id_evento -nome lotes_evento -id -id_categorias_evento -valor itens_ev...
asked by 08.06.2017 / 21:32
1
answer

Instantiate class within the bootstrap / start.php file Laravel 4.2?

I have an application running Laravel 4.2 , I have a class that takes care of IP's in blacklist , and this is saved in the database. I need when a user accesses my application the system validates if IP is in blac...
asked by 09.06.2017 / 14:38
1
answer

Eloquent: relationships between tables in a blog

One would have a practical example of using relationships in Eloquent as follows: I have a blog with several categories, in these categories I will have several Posts, as I do to display a category with several Post in Views. I've seen s...
asked by 23.01.2017 / 02:27
1
answer

Route error when accessing the page in Laravel

   composer require mnabialek / laravel-eloquent-filter The error below appears, I did not make any changes besides executing this command. ReflectionException in Route.php line 333: Method App \ Http \ Controllers \ AdvertisementC...
asked by 23.10.2016 / 02:36
1
answer

Access in the view the last values entered in the database

I'm trying to access the latest "books" inserted in the database, and display in the view. This function of the controller returns the view with the values retrieved from the bank. public function index(){ $books = Book::orderBy('cr...
asked by 11.10.2016 / 23:13
1
answer

Relationship of Tables Laravel

I have a bank with the following relationships:    I'd like to bring the Menu relationship to the Perfil of the user. In tiker I take the following steps: $user = App\Models\User::find(1); $perfil = $user->perfi...
asked by 01.10.2016 / 21:57
1
answer

How to insert multiple rows from a single query using the same ID

I'm trying to make multiple inserts using the same ID with Laravel but it's only doing 1 insert. The idea would look something like this. ped_cod|est_cod|ped_qtde 8 |2 |9 8 |3 |2 8 |4 |2 8 |9 |15...
asked by 22.09.2016 / 16:43
2
answers

Bug change position of laravel site banners

I am developing a site where it has a modal banners and want to set a field in the database of the "order", where I can decide which banner appears first, second, third ... in my admin panel I I have a list of all banners and banner that is thir...
asked by 22.09.2016 / 17:03
1
answer

Problem with laravel model 5.2

I'm having a problem with my model, I do not really know what's going on, I'm creating a packaging CRUD where I add everything dynamically with the laravel by the requests in the function signature. When trying to edit / view / delete my cont...
asked by 09.09.2016 / 01:28
1
answer

Relationship Eloquent do Laravel

I have 3 tables: -- tipos id nome -- usuarios id tipo_id nome email -- atividades id usuario_id descricao I'm using Eloquent to capture activity and user data from the activity: $results = Atividades::with('Usuario')->get(); But I...
asked by 13.01.2016 / 21:48