Desssha

Member Since 1 Month Ago

Moscow

Experience Points
480
Total
Experience

4,520 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 1
480 XP
Feb
13
2 weeks ago
Activity icon

Awarded Best Reply on Can't Upload Repository To Github

thanks for everyone try to help . i solved it and it worked

https://docs.github.com/en/github/using-git/changing-a-remotes-url

but before it i was clear cach and sing out from git

after change link use it

git push -u origin main

Activity icon

Replied to Can't Upload Repository To Github

thanks for everyone try to help . i solved it and it worked

https://docs.github.com/en/github/using-git/changing-a-remotes-url

but before it i was clear cach and sing out from git

after change link use it

git push -u origin main

Activity icon

Replied to Can't Upload Repository To Github

when i use $ git remote set url origin https://github.com/Moustafa-desha/skillshub.git error: Unknown subcommand: set usage: git remote [-v | --verbose] or: git remote add [-t ] [-m ] [-f] [--tags | --no-tags] [--mirror=<fetch|push>] or: git remote rename or: git remote remove or: git remote set-head (-a | --auto | -d | --delete | ) or: git remote [-v | --verbose] show [-n] or: git remote prune [-n | --dry-run] or: git remote [-v | --verbose] update [-p | --prune] [( | )...] or: git remote set-branches [--add] ... or: git remote get-url [--push] [--all] or: git remote set-url [--push] [] or: git remote set-url --add or: git remote set-url --delete

-v, --verbose         be verbose; must be placed before a subcommand

what should i use ?

Activity icon

Replied to Can't Upload Repository To Github

i tried it but not help anyway

Activity icon

Started a new Conversation Can't Upload Repository To Github

when i try upload show me this message

$ git remote add origin https://github.com/Moustafa-desha/skillshub.git

error: remote origin already exists.

after when i make push

git push -u origin main

show me this error

$ git push -u origin main

[email protected]: Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

Feb
12
2 weeks ago
Activity icon

Started a new Conversation Pusher Event Not Work When I Active It With Some Event In Site

pusher work if i test it for just test but when i active it for added new exam not work .

i make event class ExamAddedEvent implements ShouldBroadcast .

and this code.

   public function broadcastOn()
{
    return ['notifications-channel'];
}

public function broadcastAs()
{
    return 'exam-added';
}

my layout .

   <script src="https://js.pusher.com/7.0/pusher.min.js"></script>

	<script>
		
		// Enable pusher logging - don't include this in production
		Pusher.logToConsole = true;

		var pusher = new Pusher('99257b25d6fbd6f11efc', {
		cluster: 'eu'
		});

		var channel = pusher.subscribe('notifications-channel');
		channel.bind('exam-added', function(data) {
			alert(JSON.stringify(data));
				toastr.success('New Exam Added!')
		});
	</script>

toastr msdn i use css and js in layout and it work if i move ( toastr.success('New Exam Added!') )

in another it work when i make reload for page but it not work when i add new exam

this my Examcontroller

$exam->update([
                            'active' => 1,
                    ]);


                //    هنا هنفعل البوشر عن طريق ميسود الايفنت واسم الايفنت اللى انشاناه
                    event(new ExamAddedEvent);

                    return redirect( url("dashboard/exams") );
                }

why it not work ?

.env everything ok copy past without change .

Feb
06
3 weeks ago
Activity icon

Replied to Laravel 8 , 419 PAGE EXPIRED

yeeeees man thxs a lot 2 days i search and looking in code .

Activity icon

Replied to Laravel 8 , 419 PAGE EXPIRED

which line code now show i don't know why

Activity icon

Started a new Conversation Laravel 8 , 419 PAGE EXPIRED

when i try make update for skills it show me this page but delete and add new work this controller

Jan
18
1 month ago
Activity icon

Replied to Integrity Constraint Violation: 1451 Cannot Delete Or Update A Parent Row: A Foreign Key Constraint Fails

yes relation was one-to-many because it detach() wasn't work .

Activity icon

Replied to Integrity Constraint Violation: 1451 Cannot Delete Or Update A Parent Row: A Foreign Key Constraint Fails

thxs man it worked with me. was trying some method like it but not worked $room=Room::find($id); $room->bookings()->detach(); $room>delete(); but your method work thxs

Activity icon

Started a new Conversation Integrity Constraint Violation: 1451 Cannot Delete Or Update A Parent Row: A Foreign Key Constraint Fails

excuse me how can delete i try use of of this method but not successful

1- $room_info = Room::where("id", $id)->delete();

2-  DB::table('rooms')->where('id',$id)->delete();

i understand that Rooms have foreign in bookings what best method to delete it with foreign key. thxs

Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (hotelbooking.bookings, CONSTRAINT bookings_room_id_foreign FOREIGN KEY (room_id) REFERENCES rooms (id)) (SQL: delete from rooms where id = 3) in file

Jan
17
1 month ago
Activity icon

Replied to ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

thankssssssssssss man you are the best omg one day in this problem. it work man yeaaahh thanks alote. sorry i am new in laravel .

Activity icon

Replied to ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

when i used second give me this error ErrorException: Trying to get property 'id' of non-object in file C:\xampp\htdocs\

Activity icon

Replied to ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

like you see in error Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'user_id' cannot be null (SQL: insert into bookings (room_id, user_id, date_start, date_end, booking_number, updated_at, created_at) values (1, ?, 2021-1-18, 2021-1-20, 8475498, 2021-01-17 20:04:41, 2021-01-17 20:04:41)) in file

insert everything only user_id ? in vlues

Activity icon

Replied to ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

i do but give me error i send user_id , room_id , date_start , date_end and give me the error

Activity icon

Replied to ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

how can fixed it was change before like it give me another error $booking->user_id = $request->id; give me this error Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'user_id' cannot be null (SQL: insert into bookings (room_id, user_id, date_start, date_end, booking_number, updated_at, created_at) values (1, ?, 2021-1-18, 2021-1-20, 3986592, 2021-01-17 19:46:24, 2021-01-17 19:46:24)) in file

Activity icon

Replied to ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

it rout

Route::middleware('auth:api')->get('/user', function (Request $request) { return $request->user(); }); Route::get('rooms',[ApiHotelController::class, 'index']); Route::get('rooms/show/{id}',[ApiHotelController::class,'show']); Route::post('bookings/create',[ApiHotelController::class,'store']);

Activity icon

Replied to ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

i use postman and send post request to make new reserving in data Route::post('bookings/create',[ApiHotelController::class,'store']); this route

Activity icon

Replied to ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

how can fixed it was change before like it give me another error $booking->user_id = $request->id; Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'user_id' cannot be null (SQL: insert into bookings (room_id, user_id, date_start, date_end, booking_number, updated_at, created_at) values (1, ?, 2021-1-18, 2021-1-20, 3986592, 2021-01-17 19:46:24, 2021-01-17 19:46:24)) in file

Activity icon

Started a new Conversation ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

still not solved can any one help please

this ApiHotelController

$booking = new Booking();

        $booking->room_id = $request->room_id;
        $booking->user_id = $request->user()->id;
        $booking->date_start = $request->date_start;
        $booking->date_end = $request->date_end;
        $booking->booking_number = mt_rand(1000000, 9999999);
        $booking->save();


        return['booking_number'=>$booking->booking_number];

}

this BookingResource

class BookingResource extends JsonResource { /** * Transform the resource into an array. * * param \Illuminate\Http\Request $request * return array */ public function toArray($request) { return [ 'room_id' => $this->room_id, 'booking_number' =>$this->booking_number, 'date_start' => $this->date_start, 'date_end' => $this->date_end, ]; } }

model class Booking extends Model { use HasFactory;

protected $fillable = [
    'room_id',
    'user_id',
    'booking_number',
    'date_start',
    'date_end'
];
    public function room(){

        return   $this->belongsTo(Room::class,'room_id');
    }

    public function user(){

        return  $this->belongsTo (User::class,'user_id');
    }

model users class User extends Authenticatable { use HasFactory, Notifiable;

/**
 * The attributes that are mass assignable.
 *
 * @var array
 */
protected $fillable = [
    'name',
    'email',
    'password',
];

/**
 * The attributes that should be hidden for arrays.
 *
 * @var array
 */
protected $hidden = [
    'password',
    'remember_token',
];

/**
 * The attributes that should be cast to native types.
 *
 * @var array
 */
protected $casts = [
    'email_verified_at' => 'datetime',
];

public function bookings(){
  
    return  $this->hasMany(Booking::class);
}

public function hotels(){
    return $this->belongsToMany(Hotel::class);
}

}

Activity icon

Replied to API PostMan Problem Try To Make New Hotel Booking

when i pass this $booking->user_id = $request->user->id; or $booking->user_id = $request->user()->id give me this errorsErrorException: Trying to get property 'id' of non-object in file C:\xampp\htd)

Activity icon

Started a new Conversation API PostMan Problem Try To Make New Hotel Booking

still not solved can any one help please

this ApiHotelController

$booking = new Booking();

        $booking->room_id = $request->room_id;
        $booking->user_id = $request->user()->id;
        $booking->date_start = $request->date_start;
        $booking->date_end = $request->date_end;
        $booking->booking_number = mt_rand(1000000, 9999999);
        $booking->save();


        return['booking_number'=>$booking->booking_number];

}

this BookingResource

class BookingResource extends JsonResource { /** * Transform the resource into an array. * * param \Illuminate\Http\Request $request * return array */ public function toArray($request) { return [ 'room_id' => $this->room_id, 'booking_number' =>$this->booking_number, 'date_start' => $this->date_start, 'date_end' => $this->date_end, ]; } }

model class Booking extends Model { use HasFactory;

protected $fillable = [
    'room_id',
    'user_id',
    'booking_number',
    'date_start',
    'date_end'
];
    public function room(){

        return   $this->belongsTo(Room::class,'room_id');
    }

    public function user(){

        return  $this->belongsTo (User::class,'user_id');
    }

model users class User extends Authenticatable { use HasFactory, Notifiable;

/**
 * The attributes that are mass assignable.
 *
 * @var array
 */
protected $fillable = [
    'name',
    'email',
    'password',
];

/**
 * The attributes that should be hidden for arrays.
 *
 * @var array
 */
protected $hidden = [
    'password',
    'remember_token',
];

/**
 * The attributes that should be cast to native types.
 *
 * @var array
 */
protected $casts = [
    'email_verified_at' => 'datetime',
];

public function bookings(){
  
    return  $this->hasMany(Booking::class);
}

public function hotels(){
    return $this->belongsToMany(Hotel::class);
}

}

Jan
16
1 month ago
Activity icon

Replied to How Can I Show Only Free Rooms In Laravel

hope you find solve for your problem