Questions tagged as 'laravel-eloquent'

1
answer

Laravel activitylog, implementation error

I'm following the site documentation: link , but I'm not getting it implement the option below: Setting a subject You can specify on which object the activity is performed by using performedOn: activity() ->performedOn($someContent...
asked by 07.08.2018 / 20:23
1
answer

Iterate an array to the end from a given randomly generated index - PHP / Laravel

Good evening guys. I have an array with a few bus stops with the following information: array:9 [▼ 0 => array:4 [▼ "id" => 35 "nome" => "Parada 35 - Copacabana" "endereco_completo" => "Rua Copacabana" "tempo" => 5 ] 1 => a...
asked by 03.06.2018 / 00:56
1
answer

Perform a related table search in Laravel and page

I would like to search all the people of a given class based on the class code using Laravel: And soon after page, to make a list. Student public function turmas() { return $this->belongsToMany(Turma::class,'turma_classe', 'tur...
asked by 23.01.2018 / 13:44
1
answer

Redirect after update laravel

I'm working on a project with laravel and I came across a problem. After the Update I want to redirect the user to another specific page. In the update function of my Controller I have this code: public function update(Request $request, $id){...
asked by 27.01.2018 / 23:51
1
answer

How to do CRUD for the model in Laravel?

We can do in controller method save() o find($id) o update() and create() . How could I do that Model have this responsibility ?     
asked by 06.08.2017 / 10:02
1
answer

How do I solve this method create problem in Laravel

Well, I have a form where it contains an html input of an image. When I send the form to the Control, I do the image processing, taking its name and uploading it to the image directory. But when I look in the bank, the image name is not correct....
asked by 04.08.2017 / 18:13
1
answer

How do I send a bank query to a View in Laravel? [closed]

I have a model (table) called Member. I want to do the id count that exists in the bank. Well I did with Member :: Count ('id'). It returns me everything nice and the total id I have on the table. More when I play the view it gives an error: Spe...
asked by 06.08.2017 / 04:08
1
answer

WhereIn in Eloquent

I'm trying to implement a query with the use of whereIn in Eloquent, but it always generates an error, My code looks like this: $result = DB::query()->select('permissao') ->whereIn('id_permissoes', $variav...
asked by 20.07.2017 / 02:17
1
answer

Insert multiple rows from a single query using FOR

I'm trying to give an insert of various data using FOR but it is not working. The impression is that it is not getting the FOR data? The spec is that this happens: ID|id_proposta|id_produto|quantidade|valor|total 1 |8 |1...
asked by 27.01.2017 / 19:23
1
answer

Field return on laravel

I have the following field saved in my database: WhentryingtoreturnitintheviewbyLaravel5.2itisonlyreturning45therestisnot.Thefieldisdefinedlikethisinthedatabase: But other fields like phone are returning correctly. Does anyone know w...
asked by 19.06.2016 / 22:41