Build a Hotel Management System in Laravel 11 Part 16 | Full Project Tutorial
#Laravel11#HotelManagementSystem#WebDevelopment#PHP
#FullStackDevelopment#codingtutorial #laravelproject
#SoftwareDevelopment#HotelBooking#techtutorial
Show More Show Less View Video Transcript
0:00
hi friends welcome to T funny channel in
0:03
our last class we saw the session here
0:06
there will be the name should be coming
0:08
here when you log in the user dashboard
0:10
okay so now we have to do the some of
0:13
the things okay so we have if you click
0:16
on the uh Hotel so we have to see the
0:20
hotel rooms along with the images and we
0:24
have to appropriate price for the room
0:27
as uh various type uh such as a luxury
0:32
room uh AC or non AC that kind of
0:35
various types the based on the type the
0:38
price should be differ if it is a AC
0:41
room there is a different price if it is
0:44
a non AC different price so if it is a
0:46
luxury room there a different different
0:48
price so VIP VIP room they are different
0:51
price there are uh various type of rooms
0:54
okay so the everything we have do done
0:56
by this project okay after done the
0:58
project I'll be provide the source
1:01
right so what I'm going to do is so
1:03
first I'm going to implement those
1:06
functionality let's lets do some changes
1:10
so hotel has various images the hotel
1:15
has rooms has various image so here F
1:19
out the rooms migration so we have a
1:22
images section so this is not one image
1:25
if you put it like this we need we can
1:28
upload only one images we know don't
1:30
need to upload one images we need
1:31
instead of that we have a we need to
1:33
upload the image collection so how to
1:36
done this stuff so what I'm going to do
1:38
is I want to this one I want to drop
1:41
this table this column so how to drop
1:43
the column click on the open up another
1:46
terminal so I want to run this
1:51
Command right click so here you type PHP
1:54
and make migration drop this one should
1:57
be the uh so from which table rooms
2:01
table so the rooms
2:04
table table rooms
2:09
table which column I'm going to
2:12
drop image table you have to specify the
2:14
table name correctly sorry column name
2:17
correctly pH make migration drop which
2:20
column I'm going to drop image column
2:22
I'm going to drop from which table from
2:26
rooms table I'm going to
2:30
uh drop the column which is a room table
2:32
here drop image column from which table
2:35
rooms table you have to write the
2:37
English properly drop images column
2:40
image image drop image from underscore
2:45
from underscore room table that's it if
2:49
you run this migration
2:53
command you can see here it has been
2:56
dropped so what I'm going to after drop
2:59
here what your going to do this we have
3:00
to do some other
3:03
things
3:15
image now the migration command run
3:18
successfully the migration has been
3:21
created here the separate file so here
3:23
this a up and down function here you can
3:26
up up function you have create this
3:27
column I'm going to drop pH
3:30
uh table drop column what is the column
3:34
I'm going to drop image okay that's it
3:37
you have to keep remember to save the
3:40
option I'm going to run the command PHP
3:44
rtis
3:51
migrate here drop the thing successful
3:54
it has been dropped
3:56
successful it has been dropped this is
3:59
the efficient we have to do the program
4:01
okay this efficient things to we have to
4:04
drop the column so what after that what
4:06
you're going to do is we have to add the
4:09
another column for that the rooms I want
4:11
to add the another column uh which is a
4:15
uh so here which is I'm going to add it
4:17
here uh room type so room type so before
4:22
that I'm going to run migrate this
4:24
command so I want to create uh run the
4:27
separate table I'm going to create which
4:30
is
4:31
a PHP and make
4:34
model room type okay the you room has
4:38
different types uh AC room non AC room
4:42
luxury room AC VIP room okay so here
4:47
have to type the uh run type uh room
4:50
type this is nothing but the we have a
4:53
model has been created model and
4:54
migration file has been created press
4:57
enter key now here the migration file
4:59
has been created room type okay
5:03
perfect now here what I'm going to here
5:05
this one I'm going to this Auto
5:07
agreement ID so here you do one by one
5:10
so here what I'm going to do is I need a
5:13
columns for the room
5:16
type uh room type okay so the room type
5:20
so we have add these two things I need a
5:24
room type name name of the room type
5:28
price
5:29
okay the price we have to make it as a
5:32
decimal value like this way okay perfect
5:35
now let's file save all you have to type
5:39
the command PHP Artis and
5:43
Mig do it as professional way done it
5:47
successfully room type has been created
5:49
after
5:51
that my one is the room has various
5:55
types the the the room consist of many
6:00
images so that the people are coming to
6:02
the across your website they are first
6:04
you have to they must see the images of
6:07
the room how the how the room look like
6:10
then only they will be buy the quantity
6:14
of your rooms so that you have to uh
6:17
upload the photo as a clear photo and
6:20
only one photo is not enough you have to
6:23
upload more
6:24
than five photos then only they will be
6:27
able to choose the photos and all then
6:29
will be they will be order your hotels
6:32
room so that we have make as a
6:34
collection of rooms so I have run this
6:39
migration
6:40
command PHP par make model boom image
6:44
this is nothing but a migration so that
6:47
has been created so this different file
6:50
room images so this room images what I'm
6:53
going to is I want to implement this
6:57
one these two columns I want to
7:02
implemented one room consist of
7:06
many
7:09
images okay so here what I'm going to do
7:14
is I have a this a foreign key so the
7:17
foreign key so
7:19
here uh we have to add
7:23
rooms this for conate okay same thing
7:27
this one image is okay okay this the
7:29
same think changes no no the same thing
7:32
okay so here this is a foreign key which
7:35
is the room room table there is ID the
7:39
same ID which is available in the rooms
7:42
rooms images table is a prim fory okay
7:45
the rooms consist of many images so this
7:47
is the rooms for in key this is the
7:50
string which is a image path of the
7:52
images path that's a separate images
7:55
that's it that's the thing we have write
7:56
it over here now let's file save all
8:00
this also I'm going to migrate it so we
8:02
have run the PHP and migrate Comm now we
8:06
have a all things you have created uh
8:10
room type and images perfect after that
8:13
what I'm going to do is we have to
8:14
created a things fell after that we have
8:16
to make the relationship we have to make
8:19
the relationship right so what is the
8:22
relationship I'm going to make it so the
8:25
uh
8:27
rooms that's the rooms
8:33
this a
8:34
rules this a room room model here we
8:39
only the associate the relationship only
8:41
with which is which is one is a portel
8:43
only so here the image is not needed
8:47
then at the moment we have to remove
8:48
from
8:50
here model because I have to uh already
8:54
we have removed the images okay so the
8:57
we have make it as a collection okay so
9:00
so you can see over
9:02
here what I did here is we have a
9:04
another relationship we make it so one
9:08
room has many room types one sorry one
9:14
hotel has many
9:15
rooms the room
9:18
has many room
9:21
types
9:22
okay uh luxury room and there are so on
9:26
one room uh the room as
9:30
many room types okay so the rooms
9:35
consist of many
9:36
images the rooms consist of many
9:40
images right so here rooms
9:46
and uh rooms type we one room consist of
9:51
many room types one room consist of many
9:54
images this is the room site so if you
9:58
are going to the images section here
10:01
also we have to make the relationship so
10:03
here also we have to add the uh things
10:07
thing as
10:10
uh room type so this one I'm going to
10:13
add the room type so I want to add this
10:14
column
10:16
also this one also this as many this is
10:19
a many
10:21
side okay the many side because this is
10:23
the uh one n cons of many images so say
10:28
as many this is one is a
10:30
rooms table okay that's the thing you
10:33
have did over here so here we have to
10:35
add the additional
10:39
columns uh so this
10:47
one uh rooms uh images room images rooms
10:51
images so what I I have created as rooms
10:54
imag so here a migration
10:56
F the room images
11:04
here
11:06
ID I got rid of these two lines so here
11:09
we have to put it here as uh room room
11:13
Imes I have to put it here
11:17
as room ID and room room ID
11:31
image
11:36
part okay I Room type this are the same
11:40
thing I just copied room type as
11:46
well this also room
11:54
types room type
11:57
also name and price
12:02
name
12:05
price okay now what I'm going to do
12:08
after that I want
12:09
to this one I'm going
12:13
to uh room types room
12:15
types type also many okay one room has
12:20
many room types that one room has many
12:23
room types room type the type of the
12:26
room and price these are the columns
12:28
that's how we make the relation TI tpes
12:31
I hope you guys you understood things
12:33
well uh so we have a room we have a we
12:37
have additionally add another two models
12:40
and we have separate it and we have to
12:42
make little
12:44
bit uh extand the functionality of the
12:48
hotel management system thank you for
12:50
watching I'll be see in my next
12:51
lecturing thank you
#Hospitality Industry
#Hotels & Accommodations
#Event Venue Rentals

