Sum of sum in Laravel model
I'm building a tool that has the following hierarchy: Client > Projects > Stages Each stage has a 'price' value. The project has a 'value' attribute, which is just the dynamic sum of its stages. Now, I also want the…
I'm building a tool that has the following hierarchy: Client > Projects > Stages Each stage has a 'price' value. The project has a 'value' attribute, which is just the dynamic sum of its stages. Now, I also want the…
I have a blade template called by Lodge.upload. Within that template I have the following code: <form name="app" action="storeSummons" enctype="multipart/form-data" method="post"> In my route files I have this: Route::post('/storeSummons',[AppHttpControllersLodgesController::class,'storeSummons'])->name('storeSummons'); When I try to post from this simple form (only two…
when click I get page not found and in consle error : POST http://localhost/livewire/update 404 (Not Found) counter.blade.php <div> <h1>{{ $this->count }}</h1> <button wire:click="increment">+</button> <button wire:click="decrement">-</button> </div> in blade I have the following : @section('custom-js') @livewireScripts @endsection @section('custom-css') @livewireStyles @endsection…
I want to make a result from query after distinct and groupby This is My Code $results = DB::table('dokumen') ->join('pengadaan', 'dokumen.id_jenis_pengadaan', '=', 'pengadaan.id') ->select( DB::raw('COUNT(nama_paket) AS jml'), DB::raw('jenis_pengadaan as jenis_pengadaan'), DB::raw('tahun as tahun') ) ->groupBy('jenis_pengadaan', 'tahun') ->orderBy('tahun') ->get(); $hasil =…
Why is there always an error when doing more than seven days? public function paginated(Request $request) { $fromDate = $request->fromDate ? Carbon::parse($request->fromDate) : Carbon::now(); $toDate = $request->toDate ? Carbon::parse($request->toDate) : Carbon::now(); $query = Vehicle::with('make') ->with('class') ->with([ 'status' => function ($query)…
I'm using this Laravel package: https://github.com/spatie/browsershot to take a screenshot. It's based on Puppeteer But when I run it returns this error Error Output: Error: Could not find Chrome (ver. 119.0.6045.105). This can occur if either 1. you did not…
In my Laravel project (version 5.3), I'm sending a param in a URL: &container=0 But by the time it gets into the PHP function that creates an SQL query, it treats the zero as empty and satisfies the empty string…
My array response is as below picture. And I want to display data of first row as table header and other as table body data. How do i display the array as dynamic table header and body with below code?…
I would like to order listing_data based on listing_packages.order . Here is the query ListingData::with(['listing_package'])->orderBy('listing_package.order','desc')->paginate(24); I would like to order based on listing_package.order "DESCENDING" However, it returns SQLSTATE[42S22]: Column not found: 1054 Unknown column 'listing_package.order' in 'order clause' Here is…
I'm trying to load all the contacts with the conversation, and it's working unless I try to access the conversation attributes. $contatos = Contato::whereBelongsTo($conta)->with('Conversa')->get(); foreach ($contatos as $contato) { $saida_contato = new stdClass(); $saida_contato->nome_contato = $contato->nome; $saida_contato->id = $contato->id; $saida_contato->numero_contato…