skip to Main Content

Laravel – How to display "view" with XML file?

Oh, how ridiculously I formulated the question)) I’ll try in more detail. I have a route: Route::get('/parsers/settings/{id}', [AdminParserController::class, 'settings']) ->where('id', '[0-9]+') ->name('parsers::settings'); Then I select the required element from the XML file and convert it to a string: $xml =…

VIEW QUESTION

Laravel – compact(): Undefined variable $pesanan_details

My error compact(): Undefined variable $pesanan_details Line 138 experienced an error and a red notification on that line return view('checkout.check_out', compact('pesanan','pesanan_details')); Controller controller/PesananController <?php namespace AppHttpControllers; use AppModelsPesanan; use AppModelsPost; use AppModelsPesananDetail; use IlluminateHttpRequest; use IlluminateSupportFacadesAuth; use AppHttpControllersController; use AppHttpRequestsStorePesananRequest;…

VIEW QUESTION

Laravel PHP doesn't save in database

My Model is: <?php namespace App; use IlluminateDatabaseEloquentModel; class PedidoCliente extends Model { protected $primaryKey = 'pdc_id'; protected $table = 'scs_pedido_cliente'; } My method is: DB::beginTransaction(); try { $pedido = new PedidoCliente(); $pedido->pdc_cod = 1 $pedido->pdc_cli_cod = 1; $pedido->pdc_tpgp_cod =…

VIEW QUESTION

Laravel (10) linking me to the wrong page

I currently have a route that needs to link to a controller. The controller needs to give back the projects.blade.php file. It gives me the homepage instead. These are the routes I currently have Route::get('/', [AppHttpControllersHomepageController::class, 'index'])->name('homepage'); Route::get('/projects', [AppHttpControllersHomepageController::class, 'index'])->name('projects');…

VIEW QUESTION

Laravel – Why larastan raise error on relationLoaded method in resource file?

In resource file app/Http/Resources/PostResource.php I use method : <?php namespace AppHttpResources; use IlluminateHttpResourcesJsonJsonResource; class PostResource extends JsonResource { public function toArray($request) { $data = [ 'id' => $this->id, ... 'mediaProp'=> $this->when($this->relationLoaded('mediaProp'), new MediaPropResource($this->mediaProp)), ]; But I got error when running…

VIEW QUESTION
Back To Top
Search