Category : laravel

I am running my Laravel 8 app using free plan in Heroku. However, the issue was I’m getting prompted with an error of: Class ‘NumberFormatter’ not found Upon searching I have read a solution to install php intl extension. Can I have a guide on how exactly would I do this ? Thank you so ..

Read more

Hi I have this array code and I need to get: user_id":4 I just need to get the value 4 from user_id I have this code but it doesn’t work $myvar = $request[‘order’][0][‘user_id’]; {"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NpdGUudGVzdC9wdWJsaWMvYXBpL2xvZ2luIiwiaWF0IjoxNjIzODExMTE1LCJuYmYiOjE2MjM4MTExMTUsImp0aSI6Ind2bExlTlJHdkdpU2xmVUYiLCJzdWIiOjIsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.-Q56kEsHZgVEtaMzSS9Ub11imYjWjFbJMAug3Wx7WTg","user":{"success":true,"data":{"id":2,"auth_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NpdGUudGVzdC9wdWJsaWMvYXBpL2xvZ2luIiwiaWF0IjoxNjIzODExMTE1LCJuYmYiOjE2MjM4MTExMTUsImp0aSI6Ind2bExlTlJHdkdpU2xmVUYiLCJzdWIiOjIsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.-Q56kEsHZgVEtaMzSS9Ub11imYjWjFbJMAug3Wx7WTg","name":"Leo","email":"[email protected]","phone":"+51943363373","default_address_id":3,"default_address":{"address":"mi dirección","house":null,"latitude":"-1.327080900000001","longitude":"-10.6348053","tag":null},"delivery_pin":"51972","wallet_balance":0,"avatar":null,"tax_number":null},"running_order":null,"delivery_details":null},"order":[{"selectedaddons":[{"addon_category_name":"Comida Marina Ingredientes","addon_id":"2","addon_name":"Cangrejo Adicional","price":"32.00"}],"id":5,"restaurant_id":12,"item_category_id":2,"name":"Producto 1 Loquillo","price":"423.00","old_price":"0.00","image":"https://localhost/phpmyadmin/themes/pmahomme/img/logo_left.png","is_recommended":1,"is_popular":1,"is_new":1,"desc":"<p>321312</p>","placeholder_image":null,"is_active":1,"is_veg":null,"order_column":null,"addon_categories":[{"id":2,"name":"Comida Marina Ingredientes","type":"SINGLE","user_id":4,"created_at":"2021-06-10 20:18:37","updated_at":"2021-06-10 20:39:18","description":null,"pivot":{"item_id":5,"addon_category_id":2},"addons":[{"id":2,"name":"Cangrejo Adicional","price":"32.00","addon_category_id":2,"user_id":4,"created_at":"2021-06-10 20:20:30","updated_at":"2021-06-10 20:38:51","is_active":1},{"id":3,"name":"Pene","price":"95.00","addon_category_id":2,"user_id":4,"created_at":"2021-06-10 23:52:53","updated_at":"2021-06-10 23:52:53","is_active":1}]}],"quantity":1}],"coupon":null,"location":{"lat":"-5.187080900000001","lng":"-80.6348053","address":"midreccion","house":null,"tag":null},"order_comment":null,"total":{"productQuantity":1,"totalPrice":455},"method":"COD","payment_token":"","delivery_type":1,"partial_wallet":false,"dis":0,"pending_payment":false,"tipAmount":null} Sourc..

Read more

IlluminateRoutingExceptionsUrlGenerationException Missing required parameter for [Route: Nota_Dinas.update] [URI: Nota_Dinas/{Nota_Dina}] [Missing parameter: Nota_Dina]. (View: C:DEV21aplikasi_dinasresourcesviewsnota_dinas_edit.blade.php) How can I fix it? My Controller: public function edit(Nota_dinas $Nota_dinas) { return view(‘nota_dinas_edit’, compact(‘Nota_dinas’)); } public function update(Request $request, Nota_dinas $Nota_dinas) { $this->validate($request, [ ‘kepada’ => ‘required’, ‘dari’ => ‘required’, ‘nomor’ => ‘required’, ]); $Nota_dinas = Nota_dinas::findOrFail($Nota_dinas->id); $Nota_dinas->update([ ‘kepada’ => ..

Read more

i have a many-to-many relationship between two models User <?php namespace AppModels; use IlluminateDatabaseEloquentFactoriesHasFactory; use IlluminateDatabaseEloquentModel; use IlluminateFoundationAuthUser as Authenticatable; use IlluminateNotificationsNotifiable; use IlluminateNotificationsNotification; use IlluminateSupportFacadesHash; use LaravelPassportHasApiTokens; class User extends Model { use HasApiTokens, Notifiable,hasFactory; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ ’email’, ‘password’, ..

Read more

Images +++++++ I saw solutions but it doesn’t work. +++++++ <?php /** * MAKE AVATAR FUNCTION */ if(!function_exists(‘makeAvatar’)){ function makeAvatar($fontPath, $dest, $char){ $path = $dest; $image = imagecreate(200,200); $red = rand(0,255); $green = rand(0,255); $blue = rand(0,255); imagecolorallocate($image,$red,$green,$blue); $textcolor = imagecolorallocate($image,255,255,255); // imagettftext($image,100,0,50,150, $textcolor,$fontPath,$char); imagettftext($image,100,0,50,150, $textcolor,$fontPath,$char); imagepng($image,$path); imagedestroy($image); return $path; } } ?> +++++++ Php.ini ..

Read more