Posts by cau • 297 points
20 posts
-
0
votes2
answers68
viewsA: Check ID with a single foreach
Friend, I think you’re thinking the other way around. You want to get the logged in user’s Surveys not? Use Azy eagerload. $user = \Auth::user(); $user->load('surveys'); foreach($user->surveys…
-
0
votes1
answer25
viewsA: Restrict Only Lessons from a Course via Laravel Controller
Is that you do not make the check if the class you seek is of course. // pega o curso já com a relação das aulas dele $curso = Curso::with(['aulas' => function($query) use ($aulaid) {…
-
1
votes1
answer32
viewsA: Request all picking up only last value (LARAVEL)
Put array '[]' in the name attribute and the attribute 'Multiple' in the file tag? <input type="file" class="form-control" name="imagens[]" multiple /> Maybe that’s the problem.…
-
2
votes3
answers1426
viewsA: Pass a variable from one function to another Laravel PHP?
What was missing was a 'Return' in the first method. return $this->indexJson($cartaoRFID); Only the second function does not make any changes in the variable. If you want to return a json there…
-
0
votes1
answer31
viewsA: Problems with AJAX return
When you receive Success in ajax you already know the download url no? In the Laravel there is a Sponse for download. see: https://laravel.com/docs/5.8/responses#file-downloads After receiving the…
-
0
votes3
answers1274
viewsA: How to troubleshoot the error: Reflectionexception (-1) Class App Http Controllers admin Ufcontroller does not exist
Change that line. I think it’s case sensitive problems: $this->group(['middleware' => ['auth'], 'namespace' =>'Admin','prefix'=>'ufs'] The namespace you put 'admin' and conveniently…
-
1
votes1
answer75
viewsA: Function does not work within class [Laravel]
You must return a redirect. return redirect()->route('index.route...'); Redirect to index route... It is wrong to simply call the index method inside the store (because this is a post), you…
-
0
votes2
answers429
viewsA: Classes of validation Laravel
Buddy... you have to create a custom validation. Take a look here: https://laravel.com/docs/5.4/validation#custom-validation-Rules It’s easy and organized... I usually put a folder in App…
-
0
votes1
answer95
viewsA: Save checkbox inside While Laravel
Do so, apply a default value: $comprar01 = $request->get('comprar01', 0); OR $comprar01 = $request->has('comprar01') ? 1 : 0; In fields like 'active', which are Boolean in Migrations, and in…
-
-2
votes2
answers39
viewsA: Popular column with created id + date/time
First of all you can merge the request by adding the field. $request->merge(['code' => $valor_que_quiser]); $dataForm = $request->except('_token'); ... Give a dd($request->all()) after…
-
0
votes2
answers419
viewsA: How to upload an Laravel project to the server
Friend, take everything inside the public folder of the server, and put it in the public folder of the server, which will be public_html or www ... The rest goes one level higher. Configure the…
-
2
votes1
answer149
viewsA: How to do Insert 1 to 1, with four tables in Laravel
Friend, you have to do a review. In your code there are some typos.. e.g. There are models that have hasOne all tiny. To relate 1 to 1 is used the 'Associate': $clinico = Clinico::create($dataform);…
-
0
votes2
answers1473
viewsA: Search the database and return the value - Laravel
Try: @foreach ($cliente as $cli) <option value="{{ $cli->id }}">{{ $cli->razaosocial }}</option> @endforeach
-
0
votes1
answer702
viewsA: Route api in Laravel 5.4
Open the terminal (mac) or cmd prompt (windows), navigate to the project folder and type the following. php artisan route:list The URI can be used for existing routes. Watch out for…
-
0
votes1
answer270
viewsA: Dynamic Input, Laravel, JS
You can make the fields added with JS become array: <input type="text" name="fields[]" value=""> In the controller this field will come in array format. $fields = $request->get('fields',…
-
0
votes1
answer724
viewsA: Errorexception (E_ERROR) Undefined variable: messages
In the controller is 'Messages' uppercase! And in the view tries to take the lowercase variable in @foreach. Modify in controller to: return view('messages')->with(['messages' => $messages]);…
-
0
votes1
answer345
viewsA: How to pass a variable parameter to jquery
This way you won’t get the id. You’re not referencing the tag <a>. Do so: <div class="btn-group" role="group"> <a href="/projeto/fazer" data-id="{{$artigo->id}}" class="btn…
-
2
votes1
answer56
viewsA: Responsive CSS not read by site
Added the following meta tags to <head>? <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1">…
-
0
votes2
answers898
viewsA: Update with ajax in Laravel
If you access the route from the browser will give this error because the route is of type "POST" and you are trying to access via "GET". If you access by ajax there will occur all right. You can…
-
0
votes1
answer42
viewsA: I am looking for a way to transform JSON into a table automatically in the chorme
I don’t know if this is really what you want, but just make a loop of repetition in the Object. I used jquery for this. And still bootstrap table to style the table. HTML: <table class="table…