skip to Main Content

PHP Laravel Target class [AuthRegisterController] does not exist

I have this error and don't know where I went wrong, please help me My controller: <?php namespace AppHttpControllersAuth; use AppHttpControllersController; use AppProvidersRouteServiceProvider; use AppModelsAccount_Register; // Chắc chắn rằng bạn đã import model User use IlluminateSupportFacadesHash; use IlluminateHttpRequest; class RegisterController…

VIEW QUESTION

make a query with conditions in laravel

i wanna get the reservations that their status aren't canceled or if status is canceled it check they have unread messages or not Can you help me? class Reservation extends Model { public function unreadMessages() { return $this->hasMany(Message::class, 'reservation_id', 'id')…

VIEW QUESTION

Model not parsing from json/map in flutter

I have this function to get userData into model: Future<UserModel> getUser() async { final snap = await _fireStore .collection("users") .doc(_firebaseAuth.currentUser?.email ?? _firebaseAuth.currentUser?.phoneNumber) .get(); final data = snap.data(); debugPrint("data: $data"); // this line gives output // debugPrint("data: ${jsonDecode(data.toString())}"); -> this line…

VIEW QUESTION

Cascade delete in Laravel

I have a example of cascade delete but it looks too big and complicated, is there a way to shorten this code? protected static function boot() { parent::boot(); static::deleted(function ($parent) { // $versions = $parent->game_versions(); $versions = $parent->game_versions; foreach($versions as…

VIEW QUESTION

Laravel – Attempt to read property "episodes" on null

I wrote a code that sums the number of minutes of several videos together. But it shows the following error: Attempt to read property "episodes" on null public function setCourseTime($episode) { $course = $episode->course; $course->time = $this->getCourseTime($course->episodes->pluck('time')); $course->save(); } Model…

VIEW QUESTION
Back To Top
Search