Posts by Aguinaldo Tupy • 188 points
14 posts
-
0
votes2
answers74
viewsQ: Artisan Command - Foreach Laravel - Count affected lines
I created a command in Laravel to run at a certain time and now I need to get the result only of the affected lines. The method I used makes a count of the entire loop. $count = 0; foreach…
-
1
votes1
answer403
viewsA: Consume API with Javascript and save data in Mongodb
When consulting an API with Insomnia, you can request the code for consultation in several languages, such as: PHP, Curl, Javascript, Nodejs and among others. So I found the answer to what I was…
-
0
votes1
answer403
viewsQ: Consume API with Javascript and save data in Mongodb
Hello, Currently I have an application that Backend is in PHP and consumes a JSON API. Through the query I can save the data in my Mysql DB. I want to know if it is possible to do this in…
-
0
votes1
answer113
viewsA: Calculate total quantity, price and discount and total totals
You will need to use a query with the selectRaw or select(DB::raw sum(seucampo) as seurotulo). An example of the way I did in a project; $products = DB::table('products') ->join('order_product',…
-
4
votes1
answer51
viewsA: Join with sum in Laravel
I was able to perform the operation. Follows code; $products = DB::table('products') ->join('order_product', 'products.id', '=', 'order_product.product_id') ->select(DB::raw('products.sku,…
-
1
votes1
answer51
viewsQ: Join with sum in Laravel
I am trying to bring a JSON result from my database. $products = DB::table('products') ->join('order_product', 'products.id', '=', 'order_product.product_id') ->select('products.sku',…
-
1
votes1
answer28
viewsQ: Mysql Pivot Query
I have 3 tables and want to return 1 query making the sum of what was sold. Table 1 = products Table 2 = order Pivot table = order_product How will I bring a listing with the SKU, name and quantity…
-
0
votes0
answers63
viewsQ: Reflectionexception Laravel 5.7 instance Gcloud
I have deployed my application to a Gcloud instance and cannot access a specific page where I import files. Controller <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use…
-
1
votes1
answer47
viewsQ: UPDATE VIA CSV LARAVEL
I have this parameter to import data via CSV and I want to know how to create the UPDATE function based on the CODE field. public function importEstoque(Request $request) { $validator =…
-
0
votes1
answer455
viewsA: throw new Methodnotallowedhttpexception($others); Laravel 5.7 Sending HTML form
I was able to solve the issue by changing the opening form Of {!! Form::model(array('route' => array('colaboradores.update', $colaboration->id), 'method' => 'put')) !!} For {!!…
-
0
votes1
answer455
viewsQ: throw new Methodnotallowedhttpexception($others); Laravel 5.7 Sending HTML form
When creating the update in Laravel this giving the error. protected function methodNotAllowed(array $others) { throw new MethodNotAllowedHttpException($others); } View {!! Form::model(array('route'…
-
3
votes2
answers972
viewsA: Missing required Parameters for [Route: ] [URI: /{}/]
I changed the way to call the route and it worked Of {!! Form::open(['route' => 'colaboradores.update']) !!} To {{ Form::open(['route.name' => 'colaboradores.update']) }}…
-
4
votes2
answers972
viewsQ: Missing required Parameters for [Route: ] [URI: /{}/]
I am trying to pass an update parameter, but it is giving error. Controller public function update(ColaborationFormRequest $request, $id { $dataForm = $request->all(); $colaboration =…
-
1
votes1
answer370
viewsQ: Form::select Orange
I’m having trouble making one Form:select searching information from the database. How is the Controller; public function create() { return View('internos.create'); } How’s the View; <div…