skip to Main Content

Laravel 9 required_if not validating

I'm using Laravel 9 and Livewire 2.0 I have an integer field called 'new_weight' that should validate required if the boolean checkbox 'stripped' is selected. Although 'stripped' is not selected, it's still validating as required. The validation $rules are being…

VIEW QUESTION

Laravel Call to undefined method App\Http\Models\User::posts() while it exists (Redis Queued Listerner)

I got this error in my application, even though I already searched on Google but there is no question like this. It's weird. Error: BadMethodCallException(code: 0): Call to undefined method App\Http\Models\User::posts() at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:5 This is my User.php class User extends…

VIEW QUESTION

IlluminateDatabaseQueryBuilder::update(): Argument #1 ($values) must be of type array, stdClass given, – Laravel

How can I convert stdClass to Array to update my DB in Laravel? $currentSubscriptionTransaction = new stdClass(); $subscription_transaction_to_update = DB::table('subscription_transactions')->where('id', $currentSubscriptionTransaction->id)->first(); if (!is_null($subscription_transaction_to_update)) { DB::table('subscription_transactions')->where('id', $currentSubscriptionTransaction->id)->update( ($currentSubscriptionTransaction) ); } I tried array($currentSubscriptionTransaction) but it didn't work.

VIEW QUESTION
Back To Top
Search