Final Year Assignment Hotel Management System
Final Year Assignment Hotel Management System
Final Report
75% Individual Coursework
Acknowledgement
My final year project had a huge impact on my experience and also sharpened my skills. It would
had been impossible to finish my project if my supervisor Mr. Bipin Bhattarai and Mr. Bikash
Bhattarai were not there to support me and help me. Islington College was the reason I got to
work on the final year project (FYP). I am grateful to my client Kathmandu Prince Hotel for
accepting my proposal to develop the web application and co-operating with me when I needed
help and assistance.
In the end would like to show my gratitude to my peers and family who helped me during the
moments while I was completing my final year project (FYP).
Abstract
The main artefact of this project is to make a web based application which will make the
management system run smoothly with proper database system. The project allows the hotel
employee to have interactive GUI and can even manage room’s services and booking in a
systematic manner. As the hotel employees are a very busy people and does not have time to plan
and manage everything on paper. Now he/she has the power to do it easily with flexible time
from this project. The project will allow the hotel management to go on smoothly as it will have
features such as Check-in, Check-out, restaurant bills and reservations. As all the important part
is stored on the application it is easy to make the bill of a guest and check the availability of the
rooms beforehand. The data will be safe with only authorized people having access to the data.
The data will also be safe and can be recovered if any natural disaster takes place the data can be
restored easily. Restaurant services are also provided here which make it easier when the guest
checks out of the hotel. This system is useful both for the customer and the hotel employee
which will have a good effect on both side of.
Contents
CHAPTER 1: INTRODUCTION....................................................................................................7
1.1 Introduction to the topic........................................................................................ 7
1.1.1 Current Scenario............................................................................................7
1.2 Problem Statement...............................................................................................8
1.3 Project as a solution............................................................................................. 9
1.3.1 Aims:.............................................................................................................. 9
1.3.2 Objectives:..................................................................................................... 9
Chapter 2: Background....................................................................................................11
2.1 About the client/ end user...................................................................................... 11
2.2 Understanding the solution.................................................................................... 11
2.3 Similar Projects...................................................................................................... 12
2.4 Comparisons..........................................................................................................14
2.5 Review of technical aspects:..................................................................................15
Chapter 3: Development..................................................................................................17
3.1 Considered Methodologies:................................................................................... 17
3.2 Selected methodology:.......................................................................................... 20
3.2.1 Agile Methodology:..........................................................................................20
3.3 Phases of methodology:........................................................................................ 20
3.4 Survey results:....................................................................................................... 21
3.4.1 Pre-Survey results:..........................................................................................21
3.4.2 Post-Survey results:........................................................................................ 21
3.5 Requirement Analysis:........................................................................................... 22
3.6 Design.................................................................................................................... 23
Chapter 4: Testing and analysis...................................................................................... 25
4.1 Test Plan.................................................................................................................25
4.1.1 Unit Testing, Test Plan.....................................................................................25
4.1.2 System Testing, Test Plan............................................................................... 25
4.2 Unit Testing............................................................................................................ 26
4.3 System Testing.......................................................................................................34
4.4 Critical Analysis:.....................................................................................................41
Chapter 5: Conclusion..................................................................................................... 42
Table of figures
Figure 1 Design............................................................................................................... 23
Figure 2............................................................................................................................24
Figure 3 Logging in..........................................................................................................27
Figure 4 Successfully logged in.......................................................................................27
Figure 5: Filling information of a user.............................................................................. 28
Figure 6: Successfully added a user............................................................................... 29
Figure 7 Trying to login with fake credentials.................................................................. 30
Figure 8: error shown.......................................................................................................30
Figure 9: a normal users view......................................................................................... 31
Figure 10 : A admin level users view............................................................................... 32
Figure 11: logging out of the system................................................................................33
Figure 12: Successfully logged out..................................................................................33
Figure 13: Check-in of a guest........................................................................................ 34
Figure 14: Guest check-in created.................................................................................. 35
Figure 15: Gathering information of the guest.................................................................36
Figure 16 Data of the guest stored..................................................................................36
Figure 17 Food order of a guest......................................................................................37
Figure 18: Guest food added on their room.................................................................... 38
Figure 19: Laundry added............................................................................................... 39
Figure 20: Successfully added the data.......................................................................... 39
Figure 21 Checking out of a guest...................................................................................40
Figure 22 Completion of the checkout.............................................................................41
Figure 23 Gantt chart.....................................................................................................159
Figure 24: flowchart....................................................................................................... 159
Figure 25 Homepage of the website..............................................................................160
Figure 26 Customers List...............................................................................................160
Figure 27Restaurant order list....................................................................................... 161
Figure 28 payments list that is completed..................................................................... 161
CHAPTER 1: INTRODUCTION
1.1 Introduction to the topic
Almost all people travel around the world and not all have home around the world so they will
prefer to live in hotels. The first thing that come upon peoples mind is if they can secure a room
when they reach to their destination. This is a huge task for the staffs in hotel as lot of data of the
customers need to be stored properly and efficiently.
Implementing a system which can handle all the information about the hotel guest along with the
needed facilities all under one system would help the staffs of the hotel. The system will be
optimized to add modify the details about customer with what facilities they want to add as food
laundry and more. All will be handled by the hotel staff and will be managed well.
Humans tend to make simple error and small errors like calculating the total bill of a hotel guest
can have a huge impact on small hotels so with the help of my project Kathmandu Prince Hotel
will not have such problems and the database will be safe as well.
The utilization of data innovation in the hospitality industry has become enormously in the
course of recent years. This voyage has not generally been smooth, yet it has become certain that
information technology is presently a basic aggressive weapon in the business. On the chief
online portals, OpenTable.com, flaunted that in 2016 dining seats filled in cafés using their
online reservation framework surpassed one million. This was a 65% expansion from the earlier
year. (Montgomery, 2006)
The tourism industry business and voyaging is one of the key parts of economy in Nepal. Every
year a huge number of traveller from each side of the globe visits to encounter Nepal. In recent
years the innovative headway has soared in Nepal. However not many inns utilize a customized
computerized framework to help with a portion of the remaining task at hand. Just bunch of Star
lodging has database the board framework for recording data pertinent for the time being and for
later in regard to organization and consumer loyalty
Today, every single hotel or chain of inns, need a management system, the need is a direct
result of changing visitor observations and change in innovation, today everything is very
available to a visitor due to Internet and cloud based advancements, which offer Anytime
and Anywhere access to visitors, So lodgings need to make their essence felt on each
channel and system with most recent costs, inventories and obviously also a rundown of
administrations that they offer. (Hychinthia, 2018)
The major Drawback of Manual hotel management system over computerised are:
Time consuming.
Data are lost and employees are not aware.
Manual labour for record keeping.
Data is not always reliable as it is hand written and some human errors might have
occurred example wrong telephone number among other.
Hard time retrieving records.
Reservation process is slow.
Security is low.
Files are prone to theft unauthorized modification due to low data security levels and
standards.
1.3.1 Aims:
The point of this project is to fabricate a web application for lodgings around the world
however concentrating more on Nepal as this is the new innovation here. The system will
deal with all the fundamental services done by the hotel however the online framework
like room booking, consumer loyalty subtleties, getting ready report and some more. The
system won't be huge however if necessary in future more exertion and work should be
possible to cause it to develop regarding usefulness and usability.
1.3.2 Objectives:
To overcome the aims to complete the project I used the following steps:
Learn to design and develop HTML business applications using PHP programs
that meet commercial programming standards by the end of final academic year.
Analyse different applications similar to the proposed project to compare the
technology and ideas and benefit from them.
Gather all the requirements required for the project from different hotel managers
through face to face interview and/or questionnaire.
Identify the relevant risks for the project regarding different factors like social,
economic and environmental etc. and contingency plan for the project.
Follow the methodology, the tools and techniques that come with it to design the
software first and actually develop the software second.
Develop a database for storing the guest details and property, employee and
other details.
Develop a friendly web application which can be used for retrieving, insertion,
modification and deletion of records stored on database. The website should be
able to books the rooms, produce reports using various queries from the database
software.
Infuse the application with high security features like log in, and other relevant
technologies.
Test for any errors be it functional or logical and repair them until the system is
error proof.
Chapter 2: Background
2.1 About the client/ end user
Description: Kathmandu Prince hotel is located at Chettrapati, Kathmandu which is very close to
the main attraction for many tourists Thamel. The hotel is beautiful with a small garden
restaurant and even free pickup service from the airport. Mr Aryan Shakya agreed to be my client
after hearing what I had to offer to him and was happy to take the initiative forward. Then soon
with our understanding the Client Acceptance letter was signed by the owner Mr Aryan Shakya.
The system I provided them with has an interface which is easy to use with basic knowledge and
can easily use it. There will not be any more calculation errors and the customer’s data will be
stored safely and can be accessed at the time of need without much time being wasted. Bookings
and laundry will be managed without any problem. Humans make errors in their life we are not
programmed robots which is always perfect so with the help of the system I have completed its
going to be a huge help for the people and my client. Small errors on the bill of a customer
during checkout process can make a huge difference. If the customer finds out they have been
charged more than they are supposed to pay then they will defame the hotel and many customers
will be lost which is a very bad part for the business. The other major factor if the billing is
decreased than it is supposed to then it is going to effect the owner of the hotel as his main source
of income will be mismatched and problems might occur and even some misunderstanding can
occur between the people which will cause problem on the working environment. Here the
system I provided will keep a good track of the money along with a safety with no calculation
error and managed system which is the best.
Hotelogix
Hotelogix by HMS InfoTech is a versatile, spectacular hotel management that incorporates each
application a little or medium-sized accommodation business should be effective in present
focused market. This powerful, cloud-based arrangement is obviously appropriate for developing
autonomous lodgings, hotels, cabins, resorts, and other property types that are looking for a
moderate model that can be set up rapidly and effectively, with no enormous forthright
speculation.
Basic applications incorporate hearty front desk operations, Point of Sale, housekeeping, and
that's only the tip of the iceberg. Structured utilizing the most recent online advances, the
framework's neighbourly and graphical UI disentangles and streamlines basic regular
assignments. It's additionally very easy to understand, so lodging staff can be fully operational
rapidly with next to zero vacation.
At the centre of the framework is a thorough Property Management System (PMS) that supports
numerous properties as well as different monetary standards, making this an incredible fit for
organizations with a shifted geological impression. From this brought together centre point
clients can then effectively get to different modules: reservations, MIS or eating administrations,
and even the hotel site, all from a solitary bound together stage.
The system can be incorporated with all significant charge card instalment entryways, just as
other outsider mixes for outer CRS's, EPBAX, bookkeeping, and then some. The device used to
build up this application is PHP.
Features
Experience the power and simplicity of Centralized Dashboard for your inventory sales
through all available mediums of sale and distribution.
Sell across all sources of distribution without blocking your Room-nights. Get Real Time
updates across all channels, at the front desk.
Create rates centrally through a Powerful Rate Manager and sell across distribution
networks with rate parity.
Manage all hotel operations e.g. Check-ins, Checkouts, Revenue Reports, etc. seamlessly
through a comprehensive PMS at the core.
HoteloPro
Consolidating openness with adaptability, HoteloPro offers the chance to create advancements
from a similar application, utilizing either the advertising instrument or the POS module where
hoteliers can characterize new administrations and items.
Features
flexible pricing management - you can setup room prices in advance or you can modify
them on the fly
2.4 Comparisons
HoteloPro is a recently framed web framework that gives the comparable highlights that is
probably going to be in the framework for the last year venture. In spite of the fact that very few
highlights analyses to Hotelogix the framework is a picking up notoriety in its classification.
At the other hand Hotelogix is an entrenched web application that lifts in excess of million
income from the undertaking. The future here is by all accounts well for both the old heroes and
newcomers.
1. Database:
At the point when I chose to utilize PHP as my essential IDE, I considered whereupon database
can be utilized with PHP to give it all the more simple and productive touch. From my Research
and point by point investigation of the themes I currently realize that Database MYSQL is an
imaginative, incredible and instinctive numerous database the executive’s apparatus Browse
objects, Design tables, Edit columns, Export information and Run questions with a reliable
interface. PHP and MYSQL are especially utilized for overseeing database and web applications.
2. MY SQL:
MySQL is described as a free, quick, solid open source social database. It lacks some refinement
and offices, however it has a functioning advancement group and, as it goes from discharge to
discharge, more abilities are included. At specific occasions there will be an exchange off among
speed and capacities, and the MySQL group expect to keep their database motor quick and solid
MySQL Advantage is a suite of four open-source programming bundles demonstrated,
mainstream, and well-upheld ones–that work together to run intelligent, unique Internet locales.
sites (counting Flickr, Facebook, Wikipedia, Google (however not for look), Nokia and YouTube)
use MySQL for information stockpiling and logging of client information. (Fitzpatrick, 2020)
Features:
Because of its unique storage engine architecture MySQL performance is very high.
Supports large number of embedded applications which makes MySQL very flexible.
Use of Triggers, Stored procedures and views which allows the developer to give a
higher productivity.
Allows transactions to be rolled back, commit and crash recovery.
Triggers & cursor.
3. PHP:
PHP is an open source server-side scripting language that is fundamentally the same as in
sentence structure to C language. From this it tends to be inferred three of the essential
favourable circumstances of PHP. Right off the bat, it is a cross stage innovation and
subsequently PHP applications can be entirely versatile – depending, obviously, upon any extra
segments they are worked to join, for example, seller explicit databases and so on. This convey-
ability causes an extra advantage by righteousness of the way that most Web facilitating suppliers
support PHP, making it genuinely simple to change has if essential.
Furthermore, in light of the fact that PHP looks to some extent like C programming languages, it
is effectively gotten by designers acquainted with this sentence structure – one that is shared by
Java, JavaScript and Perl, among others. Thirdly, being open source, PHP is always advancing
and, all the more significantly, bug fixes are in effect normally actualized deeply libraries, which
are uninhibitedly accessible. (Refense, 2018)
Chapter 3: Development
1. Scrum Methodology:
Scrum is a lightweight and nimble way to deal with venture the executives that separates
an item into littler assignments, and spots them on a rundown called an overabundance.
Undertakings are taken from the build-up, in the request they should be finished, and
given to groups who work to take care of business inside a set time period called a run.
Runs endures a normal of about fourteen days, contingent upon the venture's time period
and multifaceted nature of the undertaking.
The historical backdrop of Scrum returns to 1986 when Hirakata Takeuchi and Ikujiro
Nunica first utilized the term to depict a progressively proficient approach to move
toward item improvement. The word Scrum originates from the sport of Rugby, and
alludes to when a group clusters near one another and charges trying to get the show on
the road from the rival group.
In the 1990's Ken Schamber and Jeff Sutherland utilized and refined this strategy
explicitly for programming improvement, since the prescient and cascade strategies
weren't generally
a solid match. They joined their practices, thoughts, and perceptions and made what is
authoritatively known as Scrum. (Epiicace, 2015)
2. Waterfall methodology:
The Waterfall Model was the main Process Model to be presented. It is exceptionally
easy to comprehend and utilize. In a Waterfall model, each stage must be finished before
the following stage can start and there is no covering in the stages. The cascade model is
the most punctual SDLC approach that was utilized for programming advancement.
In "The Waterfall" approach, the entire procedure of programming advancement is
isolated into independent stages. The result of one stage goes about as the contribution for
the following stage consecutively. This implies any stage in the advancement procedure
starts just if the past stage is finished. The cascade model is a consecutive plan process in
which progress is viewed as streaming consistently downwards through the periods of
Conception, Initiation, Analysis, Design, Construction, Testing,
Production/Implementation, and Maintenance. As the Waterfall Model outlines the
product improvement process in a straight successive stream; subsequently it is
additionally alluded to as a Linear-Sequential Life Cycle Model. (Oscar, 2018)
3. Kanban Methodology:
Toward the start of the 21st Century, key players inside the product business immediately
acknowledged how Kanban could be utilized to decidedly change the manners by which
items and administrations were conveyed.
With an expanded spotlight on effectiveness, and by bridling progresses in figuring
innovation, Kanban left the domain of the car business and was effectively applied to
other complex business areas, for example, IT, programming advancement, advertising,
etc.
For sure, what we currently perceive as the Kanban Method with all centre components
developed toward the start of 2007.
The least complex Kanban board may begin with three sections – "Mentioned", "In
Progress" and "Done". When developed, oversaw and working appropriately, it fills in as
an ongoing data archive, featuring bottlenecks inside the framework and whatever else
which may impede smooth working practices. (Rober, 2018)
4. XP Methodology:
Thinking back to the 1990s, the ascent of the Internet required an adjustment in
programming advancement. On the off chance that an organization's prosperity relied
upon the speed at which the organization could develop and put up items for sale to the
public, organizations expected to significantly lessen the product improvement life cycle.
5. Prince Methodology:
PRINCE is a procedure put together methodology that concentrations with respect to
association and power over the whole task, through and through. That implies ventures
are altogether arranged before the opening shot, each phase of the procedure is
unmistakably organized, and any remaining details are perfectly tied up after the task
closes. (Wrike, 2015)
All the methodologies have their own advantages. But for the FYP hotel management system I
have chosen agile method because here the requirements are known up-front but are expected to
evolve over time.
Another advantage of using Agile Method is so that the functionality can be added one after
another and testing them at the same time. By this method functionalities can be added until the
near last moment of the project completion. This methodology is a very iterative and incremental
process which has direct mixture with the client. One part can last from one to three weeks which
will be efficient to complete the project on time even with changes in circumstances. Most
importantly the main focus of the agile methodology is to satisfy the client through early and
continuous delivery for the software. The keen difference with agile methodology and other
methodology was it could let me change some requirements even during the final stage of
development which played a vital role for me choosing the methodology.
Hotel management system is a web based application which helps in making the hotel
management systematic and well planned which will have a direct impact on a hotel using a
normal way of storing and carrying out the basic. It will be focused on the end user first which
will be simple and gets the work done efficiently.
Agile is a procedure by which a group can deal with an undertaking by separating it into a few
stages and including steady coordinated effort with partners and nonstop improvement and cycle
at each stage. The Agile methodology starts with customers depicting how the final result will be
utilized and what issue it will fathom. This explains the client's desires to the undertaking group.
When the work starts, groups cycle through a procedure of arranging, executing, and assessing
which may very well change the last deliverable to meet the client's requirements better.
Continuous effort is critical, both among colleagues and with partners, to settle on completely
informed choices. (Sadh, 2017)
In the wake of dissecting the subtleties and learning about it the following stage will be to make a
real time scenario as in which we will have the option to utilize it as a model from which we can
decide the deficiencies and the additional subtleties to through various test might be
comprehended. Testing is a critical and significant part as this will choose the advantages the
deficiencies the misfortune the benefits of the task which I will do and furthermore will help me
on improving the framework by utilizing an appropriate testing methodology. Every single vital
direct related toward the venture will be assessed on what has been realized during the course or
procedure for making this task. (William, 2018)
The results of survey indicated that the hotel management system would be popular among
the customers. It pointed out to have good features implemented on it. The survey also pointed
out to the obvious fact the people in Nepal lacked attention towards technological change.
However the survey indicated that due to small projects like this things will change.
The result of the survey shows the hotel management system has a huge impact with the
people and the staff using the services. It also confirmed the pre survey was correct and the
features implemented in the project has a huge impact on them with good response.
Type of computer:
It's exceptionally exhorted that the most advantageous PCs to be utilized ought to be
minicomputers from approved sellers most consciously DELL. This will guarantee most extreme
similarity, ease of use, and unwavering quality
Operating System:
The framework investigator exhortation's that the inn ought to introduce WINDOWS 7 with an
OFFICE 2007 bundle to understand the greatest capability of the framework. The working
framework's high usefulness esteem and the serious deal of valuable devices incited the
framework examiner to suggest it as the most invaluable working framework.
Online information preparing mode will be pertinent with the room booking, corridor reservation
and guest orders replies. Batch handling will be applied at accounts office to create day by day
reports for the hotel transactions.
Networking requirements:
Since guaranteeing effective and solid correspondence at the lodging is one of the goals of the
system, the framework will depend on a system. It's suggested that fiber-optic link be utilized to
interface the PCs. This is on the grounds that; the link is invulnerable to tapping, quick
information rates and high data transfer capacity.
Software Requirements:
Hardware Requirements:
Processor : Standard processor with a speed of 1.6 GHz
RAM : 256 MB RAM or more
Hard Disk : 20 GB or more
Monitor : Standard colour monitor
Keyboard : Standard keyboard
Mouse : Standard mouse
3.6 Design
Figure 1 Design
Figure 2
Figure 3 Logging in
All of the tests conducted by myself has been successful and effective all the time which is a
very good thing as errors could cause a lot of problems. The system had worked efficiently
without any problems what so ever. The complete system was given a chance to let some users
use it and they provided with the feedback needed for me which was actually good. (Jazbel,
2019)
The people who gave the survey provided some good points about the system. The features that
are implemented on the system is extremely good and even accepted by the public which is a
very good response as it not only me who is willing to see it as a productive and a good system.
No matter how much effort I put into the system the end user is what matters as they can make
some error and the system can-not do anything. As a matter of fact if the end user does not make
some simple errors then it’s a very good system which will help the business of my client grow
properly.
Chapter 5: Conclusion
At this moment on the world everything is going computerized from small things to huge things
which has brought a huge change on our lives. A few years ago computer was not even
considered as an essential but just a rich person’s toy but the time has changed and as we all
know it has a huge impact on our lives. Huge companies likes Apple, Microsoft and many others
companies all are investing to make a better future with efficiency. (Wanghi, 2018)Tourism has
boosted all around the world and hotels need to manage their data properly and taxes well. Major
parts of the world need to manage their customers as anything can happen and even data which
were over a decade ago can have a huge impact on some cases. People often makes some
mistakes and with a proper management system those error will be deleted. Data will be stored
properly and bills with some features with of the hotel can be added easily without any errors.
Sometime people forget the things needed by the customer but with proper management then it
can’t be forgotten and easy management.
As of now the legal problem is of some issues on the context of our country Nepal as the
government which is hotel association Nepal issued a white paper asking the owner to take some
power over the rising sector related with the hotel. As our project is implemented to the hotel
with proper permit of running their industry it will not be a problem for us who are developing a
proper management system for them. There can occur some issues if I use the code of other
programmer’s which will cause a huge problem if caught but as I haven’t used the code of any
other people it will not be a problem to me or my client. The hotel industry is booming in our
country and will need a proper management system. With the help of my project the hotel will
have an automated way of making bills and tracking them properly so there will be less chances
for the hotel owner to hide the taxes which is a huge win for the government as they will have a
secure feeling when these type of projects are implemented on most of the hotels business. Some
customers may be on the blacklist and the proper management of the data of the customer will
help secure some proper
proof if any cases arise in the future and the hotel can play a vital role helping the proper people
involved on the case. (Jyasth, 2019)
The people of my client’s area have a high demand of proper hotel rooms its near Thamel area
which is in the heart of the city and the place where tourists prefer to live in. The area is full of
hotels and many customers are mostly there on the hotel so it’s a huge win if the customer’s
needs are fulfilled properly and their information is placed secure. Not all people are perfect and
often make mistakes here and there which will cause a huge impact on the face of a hotel if the
customer is not satisfied with their needs and most of the issues caused by this is less people
around the hotel which will be very bad for the people related to the hotel business. Hospitality
and trust of the customers is important for business like these as each time they suggest some
other people about the hotel should have better experience with the people. Small things like this
can affect the overall growth of the business and with the help of my project they will not have
some problems like there bills getting mixed up with some other people or miscalculation can
effect a lot on the customer as no people in the world would want to pay more than they had
done. So proper management can solve problems similar to them and will run properly.
(Rameshwaram, 2018)
The projects main function is to manage the database of the customers and keep track of them
properly. Details about the customers such as their name passport, photo, address, phone number
is stored on the database which is very sensitive data on the wrong hands. Identity theft is a major
problem at the moment this is a complex process where a person gets all the needed information
of a certain people and change their old identity and become a whole new person. The people can
commit many crimes and do some fraud work under the name of the other person this is a serious
issue and people need to be careful from such people as this can be a huge setback to any
business if their data is leaked into the wrong hands it is unethical to do so. Some companies and
hotels have ties with some criminal organizations and sell the data of the customer which is
worthless for them but to the criminal world it is a jackpot and the people will suffer a lot from
such cases of their identity being stolen. Now imagine you getting caught by the police for some
action you
never did or some bills coming to your home due to the expenses due kept under their name with
the identity which have been stolen. (KIm, 2017)
5.2 Advantages:
The project I created for the client is going to be a huge change for them and will have a lot of
advantages over the old manual process which can be listed down below:
1. Speed of the procedure: Inn frameworks are intended to effectively spare, recover, send,
compute and match up information into the database in this way making the procedures
quick. Having quick exchanges gets more cash-flow, great client experience and
advantageous for lodging clients.
3. Ongoing outcomes: PCs with high details in addition to an elite inn framework would
give ongoing outcomes from any exchanges like sparing information sources of info,
refreshing and erasing of information passages.
4. Exact Daily Revenue Reports: Because of the constant and mistake free highlights, inn
directors approach an exact day by day income reports that can be either appeared or
printed.
5. Forestall Double Booking. In manual tasks, twofold reserving is a typical situation yet
neighbourliness programming can stay away from this event because of framework
trappings and checks.
6. Market division: With a lodging framework, administrators and proprietors can all the
more likely track the sorts of guests that typically have and from that information they
can check whether their business is focusing on the correct market.
7. Coordinated effort of different offices. There are numerous sorts of inn clients that has a
place with a particular office or division, with a lodging framework it can advance great
coordinated effort different offices because of constant announcing and show status.
5.3 Limitations:
Even with all the advantage the management system has provided there are still some limitations:
Visitor/Guest:
1. In the event that there is a force disappointment while reserving a spot, all the data must be
given once more.
2. In the event that there is a force cut while there is a registration or registration, the visitor need
to sit tight for full server fire up, which make him/her furious.
Staff:
1. In the event that one staff mistypes the data than the visitor may blow up.
2. On the off chance that there is a force disappointment, while reserving a spot than the staff
must re-try the entire reservation.
3. At the point when late evening reviewing is being done all other client's must be logged off
4. In the event that there is an infection assault the put away data can be degenerate and an
inappropriate data might be given to the visitor which may drive him mad.
Hotel:
3. High danger of infection assault as the frameworks are associated with the web more often
than not.
4. On the off chance that there is an infection assault the put away data may get degenerate.
5. In the event that there is a force disappointment, the inn runs a high danger of losing all the put
away data.
6. In the event that late evening reviewing is missed one day there may be an annihilation the
following day.
7. Most urban areas/nations don't have nearby help. Bolster is conceivable through online just
and some of the time it requires some investment.
The project might have some bugs on it but as of now I haven’t found one yet. My system is
managed for the present scenario of the hotel the functions and every other features added on the
system is for the present. Everything evolves with time same as the hotel using the system I
provided from the old manual database system which could have many errors in the past and
even misplaced many of the data hard copy. Similarly the hotel can add some features to make it
more comforting and welcome to the guest visiting the hotel. The methodology I chose was for
this case to as we can change the program even after the final stage easily and the program can
be used to add new functions according to their need. This project is open to change and many
things are possible and important. Everything with time evolves and changes accordingly so with
time the changes in the project is possible and open to it.
Chapter 6:
References
Epiicace. (2015) azengdo [Online]. Available from: https://blog.azendoo.com/scrum-
project-management-methodology- explained/#:~:text=Scrum%20is%20a
%20lightweight%20and,set%20timeframe%20call ed%20a%20sprint. [Accessed 25
April 2020].
Fitzpatrick, J. (2020) Oracle [Online]. Available from:
https://searchoracle.techtarget.com/definition/MySQ.
Hychinthia. (2018) HN [Online]. Available from:
https://www.hospitalitynet.org/opinion/4087001.html [Accessed 01 January 2020].
Jazbel. (2019) analu [Online]. Available from:
https://www.ukessays.com/essays/computer-science/analysis-of-a-hotel-database-
management-system-computer-science- essay.php#:~:text=This%20is%20software
%20which%20has,and%20room%20in%20th e%20hotel. [Accessed 15 may 2020].
Josh, C. (2019) Lucid chart [Online]. Available from:
https://www.lucidchart.com/blog/what-is-extreme-programming [Accessed 8 may 2020].
Jyasth. (2019) HM [Online]. Available from:
https://www.hotelmanagement.net/legal/hotel-association-nepal-issues-white-paper-to-
curb-booming-hotel-industry [Accessed 20 May 2020].
KIm. (2017) HR [Online]. Available from: https://digitalcommons.fiu.edu/cgi/viewcontent.cgi?
article=1491&context=hospitalityrevi ew&httpsredir=1&referer= [Accessed 5 May 2020].
Montgomery. (2006) Open table [Online]. Available from: https://www.opentable.com/
[Accessed 04 January 2020].
Oscar. (2018) toolsqa [Online]. Available from: https://www.toolsqa.com/software-
testing/waterfall- model/#:~:text=The%20waterfall%20model%20is%20a,Production
%2FImplementation
%2C%20and%20Maintenance. [Accessed 5 May 2020].
Rameshwaram. (2018) mocit [Online]. Available from:
https://mocit.gov.np/application/resources/admin/uploads/source/EConsultation/Final%2
0Book.pdf [Accessed 25 May 2020].
Refense. (2018) W3Schools [Online]. Available from:
https://www.w3schools.com/php/php_intro.asp [Accessed 5 January 2020].
Chapter 7: Bibliography
Bibliography
Epiicace. (2015) azengdo [Online]. Available from: https://blog.azendoo.com/scrum-
project-management-methodology- explained/#:~:text=Scrum%20is%20a
%20lightweight%20and,set%20timeframe%20call ed%20a%20sprint. [Accessed 25
April 2020].
Fitzpatrick, J. (2020) Oracle [Online]. Available from:
https://searchoracle.techtarget.com/definition/MySQ.
Hychinthia. (2018) HN [Online]. Available from:
https://www.hospitalitynet.org/opinion/4087001.html [Accessed 01 January 2020].
Jazbel. (2019) analu [Online]. Available from:
https://www.ukessays.com/essays/computer-science/analysis-of-a-hotel-database-
management-system-computer-science- essay.php#:~:text=This%20is%20software
%20which%20has,and%20room%20in%20th e%20hotel. [Accessed 15 may 2020].
Josh, C. (2019) Lucid chart [Online]. Available from:
https://www.lucidchart.com/blog/what-is-extreme-programming [Accessed 8 may 2020].
Jyasth. (2019) HM [Online]. Available from:
https://www.hotelmanagement.net/legal/hotel-association-nepal-issues-white-paper-to-
curb-booming-hotel-industry [Accessed 20 May 2020].
KIm. (2017) HR [Online]. Available from: https://digitalcommons.fiu.edu/cgi/viewcontent.cgi?
article=1491&context=hospitalityrevi ew&httpsredir=1&referer= [Accessed 5 May 2020].
Montgomery. (2006) Open table [Online]. Available from: https://www.opentable.com/
[Accessed 04 January 2020].
Oscar. (2018) toolsqa [Online]. Available from: https://www.toolsqa.com/software-
testing/waterfall- model/#:~:text=The%20waterfall%20model%20is%20a,Production
%2FImplementation
%2C%20and%20Maintenance. [Accessed 5 May 2020].
Rameshwaram. (2018) mocit [Online]. Available from:
https://mocit.gov.np/application/resources/admin/uploads/source/EConsultation/Final%2
0Book.pdf [Accessed 25 May 2020].
Refense. (2018) W3Schools [Online]. Available from:
https://www.w3schools.com/php/php_intro.asp [Accessed 5 January 2020].
Chapter 8: Appendix
8.1 Appendix A: Survey
8.1.1 Pre Survey
8.1.2 Post Survey (My project is client based so the acceptance letter
is provided):
Agent controller
<?php
namespace App\Http\Controllers;
use App\Forms\Agent\Store;
use App\Forms\Agent\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreAgent;
use App\Http\Requests\UpdateAgent;
use App\Repositories\Agent\AgentRepositoryInterface;
use App\Services\Agent\AgentServiceInterface;
use App\Models\Agent;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Agent as AgentResource;
use App\Http\Resources\AgentCollection;
{
protected $agentRepository;
protected $agentService;
/**
* AgentController constructor.
*
* @param AgentRepositoryInterface $agentRepository
* @param AgentServiceInterface $agentService
*/
public function construct(AgentRepositoryInterface $agentRepository,
AgentServiceInterface $agentService)
{
$this->agentRepository = $agentRepository;
$this->agentService = $agentService;
}
/**
* Display a listing of the agent.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.napep',
[ 'records' => $this->agentRepository-
>all(), 'pageTitle' => 'Configuration',
'tableTitle' => 'Agents',
/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}
/**
* Store a newly created agent in storage.
*
* @param StoreAgent $request
* @return RedirectResponse|Redirector
*/
public function store(StoreAgent $request)
{
return $this->agentService->create($request)
? redirect(route('agents.index'))->with('success', 'New agent created
successfully.')
: back()->with('error', 'New agent could not be created.');
/**
* Display the specified agent.
*
* @param Agent $agent
* @return void
*/
public function show(Agent $agent)
{
abort(404);
}
/**
* Display the form to update user.
*
* @param Agent $agent
* @return Factory|View
*/
public function edit(Agent $agent)
{
return view('components.form.index',
[ 'setup' => (new Update($agent))-
>setup()
]);
}
/**
* Update the specified agent in storage.
*
* @param UpdateAgent $request
* @param Agent $agent
* @return RedirectResponse|Redirector
*/
public function update(UpdateAgent $request, Agent $agent)
{
return $this->agentService->update($request, $agent->id)
? redirect(route('agents.index'))->with('success', 'Agent updated successfully.')
: back()->with('error', 'The agent could not be updated.');
}
/**
* Remove the specified agent from storage.
*
* @param Agent $agent
* @return RedirectResponse|Redirector
*/
public function destroy(Agent $agent)
{
return $this->agentService->delete($agent->id)
? redirect(route('agents.index'))->with('success', 'Agent deleted successfully.')
: back()->with('error', 'The agent could not be deleted.');
}
}
Check-in
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreCheckIn;
use App\Http\Requests\UpdateCheckIn;
use App\Models\Room;
use App\Repositories\CheckIn\CheckInRepositoryInterface;
use App\Repositories\Room\RoomRepositoryInterface;
use App\Services\CheckIn\CheckInServiceInterface;
use App\Models\CheckIn;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
/**
* CheckInController constructor.
*
* @param CheckInRepositoryInterface $checkinRepository
* @param CheckInServiceInterface $checkinService
*/
public function construct(CheckInRepositoryInterface $checkinRepository,
CheckInServiceInterface $checkinService, RoomRepositoryInterface
$roomRepository)
{
$this->checkinRepository = $checkinRepository;
$this->checkinService = $checkinService;
$this->roomRepository = $roomRepository;
}
/**
* Display a listing of the checkin.
*
* @return Factory|View
*/
public function index(Request $request)
{
if($request->has('archived') && $request->archived = "true"){
$data = $this->checkinRepository->where([
['check_out', '!=' ,null]
]);
$color = 'warning';
}else {
$data = $this->checkinRepository->where([
['check_out', null]
]);
$color = 'primary';
}
return view('checkins.index', [
'checkins' => $data,
'color' => $color
]);
}
/**
* Create new check ins.
*
* @return Factory|View
*/
public function create()
{
return view('checkins.create', [
'rooms' => $this->roomRepository->getFreeRooms(),
]);
}
/**
* Store a newly created checkin in storage.
*
* @param StoreCheckIn $request
* @return RedirectResponse|Redirector
*/
public function store(StoreCheckIn $request)
{
return $this->checkinService->create($request)
? redirect(route('checkins.index'))->with('success', 'New checkin created
successfully.')
: back()->with('error', 'New checkin could not be created.');
}
/**
* Display the specified checkin.
*
* @param CheckIn $checkin
* @return Factory|View
*/
public function show(Request $request, CheckIn $checkin)
{
if($request->has('tab')
&& !empty($request->tab)
&& in_array($request->tab, ['meals', 'restaurant', 'laundry']))
{ return view('checkins.tabs.' . $request->tab,
compact('checkin'));
}else{
return view('checkins.tabs.index', compact('checkin'));
}
}
/**
* Edit the checkin.
*
* @param Request $request
* @param CheckIn $checkin
* @return Factory|View
*/
public function edit(Request $request, CheckIn $checkin)
{
$rooms = $this->roomRepository->getFreeRooms();
$merged = $rooms->merge($checkin->rooms);
$rooms = $merged->all();
return view('checkins.edit', compact(['checkin', 'rooms']));
}
/**
* Update the specified checkin in storage.
*
* @param UpdateCheckIn $request
* @param CheckIn $checkin
* @return RedirectResponse|Redirector
*/
public function update(UpdateCheckIn $request, CheckIn $checkin)
{
return $this->checkinService->update($request, $checkin->id)
? back()->with('success', 'CheckIn updated successfully.')
: back()->with('error', 'The checkin could not be updated.');
}
/**
* Remove the specified checkin from storage.
*
* @param CheckIn $checkin
* @return RedirectResponse|Redirector
*/
public function destroy(CheckIn $checkin)
{
return $this->checkinService->delete($checkin->id)
? redirect(route('checkins.index'))->with('success', 'CheckIn deleted
successfully.')
: back()->with('error', 'The checkin could not be deleted.');
}
}
Check-out
<?php
namespace App\Http\Controllers;
use App\Models\CheckIn;
use App\Repositories\CheckIn\CheckInRepositoryInterface;
use App\Services\CheckIn\CheckInServiceInterface;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
/**
* CheckInController constructor.
*
* @param CheckInRepositoryInterface $checkinRepository
* @param CheckInServiceInterface $checkinService
*/
public function construct(CheckInRepositoryInterface $checkinRepository,
CheckInServiceInterface $checkinService)
{
$this->checkinRepository = $checkinRepository;
$this->checkinService = $checkinService;
}
/**
* Checkout the guest.
*
* @param Request $request
* @param CheckIn $checkin
*/
public function checkout(Request $request, CheckIn $checkin)
{
if($request->has('skipPayment') && $request->skipPayment === "true"){
return $this->checkinService->checkout($checkin);
}else {
return $this->checkinService->checkoutWithPayment($request, $checkin);
}
}
}
Customer
<?php
namespace App\Http\Controllers;
use App\Http\Requests\StoreCustomer;
use App\Http\Requests\UpdateCustomer;
use App\Repositories\Customer\CustomerRepositoryInterface;
use App\Services\Customer\CustomerServiceInterface;
use App\Models\Customer;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Auth;
use Illuminate\View\View;
/**
* CustomerController constructor.
*
* @param CustomerRepositoryInterface $customerRepository
/**
* Display a listing of the customer.
*
* @return Factory|View
*/
public function index()
{
return view('customers.index', [
'customers' => $this->customerRepository->all()
]);
}
/**
* Form to create a new customer.
* Form to create a new customer.
*
* @return Factory|View
*/
public function create()
{
return view('customers.form');
}
/**
* Store a newly created customer in storage.
*
* @param StoreCustomer $request
* @return RedirectResponse|Redirector
*/
public function store(StoreCustomer $request)
{
return $this->customerService->create($request)
? redirect(route('customers.index'))->with('success', 'New customer created
successfully.')
: back()->with('error', 'New customer could not be created.');
}
/**
* Display the specified customer.
*
* @param Customer $customer
* @return void
*/
public function show(Customer $customer)
{
abort(404);
}
/**
/**
* Update the specified customer in storage.
*
* @param Request $request
* @param UpdateCustomer $customer
* @return RedirectResponse|Redirector
*/
public function update(UpdateCustomer $request, Customer $customer)
{
return $this->customerService->update($request, $customer->id)
? redirect(route('customers.index'))->with('success', 'Customer updated
successfully.')
: back()->with('error', 'The customer could not be updated.');
}
/**
* Remove the specified customer from storage.
*
* @param Customer $customer
* @return RedirectResponse|Redirector
*/
public function destroy(Customer $customer)
{
return $this->customerService->delete($customer->id)
? redirect(route('customers.index'))->with('success', 'Customer deleted
successfully.')
: back()->with('error', 'The customer could not be deleted.');
}
}
Food
<?php
namespace App\Http\Controllers;
use App\Forms\Food\Store;
use App\Forms\Food\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreFood;
use App\Http\Requests\UpdateFood;
use App\Repositories\Food\FoodRepositoryInterface;
use App\Services\Food\FoodServiceInterface;
use App\Models\Food;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Food as FoodResource;
use App\Http\Resources\FoodCollection;
/**
* FoodController constructor.
*
* @param FoodRepositoryInterface $foodRepository
* @param FoodServiceInterface $foodService
*/
public function construct(FoodRepositoryInterface $foodRepository,
FoodServiceInterface $foodService)
{
$this->foodRepository = $foodRepository;
$this->foodService = $foodService;
}
/**
* Display a listing of the food.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.ndp',
[ 'records' => $this->foodRepository-
>all(), 'pageTitle' => 'Configuration',
'tableTitle' => 'Menu Items',
'routePrefix' => 'foods',
'label' => 'menu item'
]);
}
/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}
/**
* Store a newly created food in storage.
*
* @param StoreFood $request
* @return RedirectResponse|Redirector
*/
/**
* Display the specified food.
*
* @param Food $food
* @return void
*/
public function show(Food $food)
{
abort(404);
}
/**
* Display the form to update user.
*
* @param Food $food
* @return Factory|View
*/
public function edit(Food $food)
{
return view('components.form.index',
[ 'setup' => (new Update($food))-
>setup()
]);
}
/**
* Update the specified food in storage.
*
* @param UpdateFood $request
* @param Food $food
* @return RedirectResponse|Redirector
*/
public function update(UpdateFood $request, Food $food)
{
return $this->foodService->update($request, $food->id)
? redirect(route('foods.index'))->with('success', 'Food updated successfully.')
: back()->with('error', 'The food could not be updated.');
}
/**
* Remove the specified food from storage.
*
* @param Food $food
* @return RedirectResponse|Redirector
*/
public function destroy(Food $food)
{
return $this->foodService->delete($food->id)
? redirect(route('foods.index'))->with('success', 'Food deleted successfully.')
: back()->with('error', 'The food could not be deleted.');
}
}
Home
<?php
namespace App\Http\Controllers;
use App\Models\CheckIn;
use App\Models\LaundryOrder;
use App\Models\Payment;
use App\Models\RestaurantOrder;
use Carbon\Carbon;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\Request;
use Illuminate\View\View;
$data = $this->getWeekStats();
break;
case 'month':
$data = $this->getMonthStats();
break;
default:
$data = $this->getTodayStats();
}
}else {
$data = $this->getTodayStats();
}
return view('home', compact('data'));
}
$payments = 0;
foreach(Payment::whereBetween('created_at', [
Carbon::now()->startOfWeek(Carbon::SUNDAY), Carbon::now()-
>endOfWeek(Carbon::SATURDAY)
])
->get() as $payment){
$payments = $payments + ($payment->total + ((13/100) * $payment->total) -
$payment->discount);
}
$payments = number_format($payments, 2, '.', ',');
$restaurant = RestaurantOrder::whereBetween('created_at',
[ Carbon::now()->startOfWeek(Carbon::SUNDAY),
Carbon::now()-
>endOfWeek(Carbon::SATURDAY)
])
->count();
$laundry = LaundryOrder::whereBetween('created_at',
[ Carbon::now()->startOfWeek(Carbon::SUNDAY),
Carbon::now()-
>endOfWeek(Carbon::SATURDAY)
])
->count();
$payments = 0;
foreach(Payment::whereMonth('created_at', date('m'))
->whereYear('created_at', date('Y'))
->get() as $payment){
$payments = $payments + ($payment->total + ((13/100) * $payment->total) -
$payment->discount);
}
$payments = number_format($payments, 2, '.', ',');
$restaurant = RestaurantOrder::whereMonth('created_at', date('m'))
->whereYear('created_at', date('Y'))
->count();
$laundry = LaundryOrder::whereMonth('created_at', date('m'))
->whereYear('created_at', date('Y'))
->count();
return compact(['checkin', 'payments', 'restaurant', 'laundry']);
}
}
Laundry
<?php
namespace App\Http\Controllers;
use App\Forms\Laundry\Store;
use App\Forms\Laundry\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreLaundry;
use App\Http\Requests\UpdateLaundry;
use App\Repositories\Laundry\LaundryRepositoryInterface;
use App\Services\Laundry\LaundryServiceInterface;
use App\Models\Laundry;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Laundry as LaundryResource;
use App\Http\Resources\LaundryCollection;
/**
* LaundryController constructor.
*
* @param LaundryRepositoryInterface $laundryRepository
* @param LaundryServiceInterface $laundryService
*/
public function construct(LaundryRepositoryInterface $laundryRepository,
LaundryServiceInterface $laundryService)
{
$this->laundryRepository = $laundryRepository;
$this->laundryService = $laundryService;
}
/**
* Display a listing of the laundry.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.ndp', [
'records' => $this->laundryRepository->all(),
'pageTitle' => 'Configuration',
'tableTitle' => 'Laundry Items',
'routePrefix' => 'laundries',
'label' => 'laundry item'
]);
}
/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}
/**
* Store a newly created laundry in storage.
*
* @param StoreLaundry $request
* @return RedirectResponse|Redirector
*/
public function store(StoreLaundry $request)
{
return $this->laundryService->create($request)
? redirect(route('laundries.index'))->with('success', 'New laundry created
successfully.')
: back()->with('error', 'New laundry could not be created.');
}
/**
* Display the specified laundry.
*
* @param Laundry $laundry
* @return void
*/
public function show(Laundry $laundry)
{
abort(404);
}
/**
* Display the form to update user.
*
* @param Laundry $laundry
* @return Factory|View
*/
public function edit(Laundry $laundry)
{
return view('components.form.index', [
'setup' => (new Update($laundry))->setup()
]);
}
/**
* Update the specified laundry in storage.
*
* @param UpdateLaundry $request
* @param Laundry $laundry
* @return RedirectResponse|Redirector
*/
public function update(UpdateLaundry $request, Laundry $laundry)
{
return $this->laundryService->update($request, $laundry->id)
? redirect(route('laundries.index'))->with('success', 'Laundry updated
successfully.')
: back()->with('error', 'The laundry could not be updated.');
}
/**
* Remove the specified laundry from storage.
*
* @param Laundry $laundry
* @return RedirectResponse|Redirector
*/
public function destroy(Laundry $laundry)
{
return $this->laundryService->delete($laundry->id)
? redirect(route('laundries.index'))->with('success', 'Laundry deleted
successfully.')
: back()->with('error', 'The laundry could not be deleted.');
}
}
Laundry Control
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreLaundryOrder;
use App\Http\Requests\UpdateLaundryOrder;
use App\Models\Food;
use App\Models\Laundry;
use App\Repositories\LaundryOrder\LaundryOrderRepositoryInterface;
use App\Repositories\Room\RoomRepositoryInterface;
use App\Services\LaundryOrder\LaundryOrderServiceInterface;
use App\Models\LaundryOrder;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
/**
* LaundryOrderController constructor.
*
* @param LaundryOrderRepositoryInterface $laundryorderRepository
* @param LaundryOrderServiceInterface $laundryorderService
* @param RoomRepositoryInterface $roomRepository
*/
/**
* Display a listing of the laundryorder.
*
* @return Factory|View
*/
public function index()
{
return view('orders.index', [
'records' => $this->laundryorderRepository->all(),
'pageTitle' => 'Laundry',
'routePrefix' => 'laundryorders',
'itemName' => 'laundry'
]);
}
/**
* Display the form to create laundry order.
*
* @return Factory|View
*/
public function create()
{
return view('orders.form', [
'rooms' => $this->roomRepository->getCheckedInRooms(),
'items' => Laundry::all(),
'pageTitle' => 'Laundry',
'routePrefix' => 'laundryorders',
'itemName' => 'laundry'
]);
}
/**
* Store a newly created laundryorder in storage.
*
* @param StoreLaundryOrder $request
* @return RedirectResponse|Redirector
*/
public function store(StoreLaundryOrder $request)
{
return $this->laundryorderService->create($request)
? redirect(route('laundryorders.index'))->with('success', 'New order created
successfully.')
: back()->with('error', 'New order could not be created.');
}
/**
* Display the specified laundryorder.
*
/**
* Displays the form to edit laundry order.
*
* @param LaundryOrder $laundryorder
* @return Factory|View
*/
public function edit(LaundryOrder $laundryorder)
{
return view('orders.form', [
'rooms' => $this->roomRepository->getCheckedInRooms(),
'record' => $laundryorder,
'items' => Laundry::all(),
'pageTitle' => 'Laundry',
'routePrefix' => 'laundryorders',
'itemName' => 'laundry'
]);
}
/**
* Update the specified laundryorder in storage.
*
* @param UpdateLaundryOrder $request
* @param LaundryOrder $laundryorder
* @return RedirectResponse|Redirector
*/
public function update(UpdateLaundryOrder $request, LaundryOrder $laundryorder)
{
return $this->laundryorderService->update($request, $laundryorder->id)
? redirect(route('laundryorders.index'))->with('success', 'Order updated
successfully.')
: back()->with('error', 'The order could not be updated.');
}
/**
* Remove the specified laundryorder from storage.
*
* @param LaundryOrder $laundryorder
* @return RedirectResponse|Redirector
*/
public function destroy(LaundryOrder $laundryorder)
{
return $this->laundryorderService->delete($laundryorder->id)
? redirect(route('laundryorders.index'))->with('success', 'Order deleted
successfully.')
: back()->with('error', 'The order could not be deleted.');
}
}
Meal
<?php
namespace App\Http\Controllers;
use App\Forms\Meal\Store;
use App\Forms\Meal\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreMeal;
use App\Http\Requests\UpdateMeal;
use App\Repositories\Meal\MealRepositoryInterface;
use App\Services\Meal\MealServiceInterface;
use App\Models\Meal;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Meal as MealResource;
use App\Http\Resources\MealCollection;
/**
* MealController constructor.
*
* @param MealRepositoryInterface $mealRepository
* @param MealServiceInterface $mealService
*/
public function construct(MealRepositoryInterface $mealRepository,
MealServiceInterface $mealService)
{
$this->mealRepository = $mealRepository;
$this->mealService = $mealService;
}
/**
* Display a listing of the meal.
*
* @param Request $request
* @return Factory|View
* @throws \Exception
*/
public function index(Request $request)
{
return view('components.table.ndp',
[ 'records' => $this->mealRepository-
>all(), 'pageTitle' => 'Configuration',
'tableTitle' => 'Meal Plans',
'routePrefix' => 'meals',
'label' => 'meal plan'
]);
/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}
/**
* Store a newly created meal in storage.
*
* @param StoreMeal $request
* @return RedirectResponse|Redirector
*/
public function store(StoreMeal $request)
{
return $this->mealService->create($request)
? redirect(route('meals.index'))->with('success', 'New meal created
successfully.')
: back()->with('error', 'New meal could not be created.');
}
/**
/**
* Display the form to update user.
*
* @param Meal $meal
* @return Factory|View
*/
public function edit(Meal $meal)
{
return view('components.form.index',
[ 'setup' => (new Update($meal))-
>setup()
]);
}
/**
* Update the specified meal in storage.
*
* @param UpdateMeal $request
* @param Meal $meal
* @return RedirectResponse|Redirector
*/
public function update(UpdateMeal $request, Meal $meal)
{
return $this->mealService->update($request, $meal->id)
? redirect(route('meals.index'))->with('success', 'Meal updated successfully.')
: back()->with('error', 'The meal could not be updated.');
}
/**
* Remove the specified meal from storage.
*
* @param Meal $meal
* @return RedirectResponse|Redirector
*/
public function destroy(Meal $meal)
{
return $this->mealService->delete($meal->id)
? redirect(route('meals.index'))->with('success', 'Meal deleted successfully.')
: back()->with('error', 'The meal could not be deleted.');
}
}
Payment
<?php
namespace App\Http\Controllers;
use App\Http\Requests\StorePayment;
use App\Http\Requests\UpdatePayment;
use App\Models\CheckIn;
use App\Repositories\CheckIn\CheckInRepositoryInterface;
use App\Repositories\Payment\PaymentRepositoryInterface;
use App\Services\CheckIn\CheckInServiceInterface;
use App\Services\Payment\PaymentServiceInterface;
use App\Models\Payment;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
/**
* PaymentController constructor.
*
* @param PaymentRepositoryInterface $paymentRepository
* @param PaymentServiceInterface $paymentService
*/
/**
* Display the list of payments.
*
*/
public function index()
{
return view('payments.index', [
'payments' => $this->paymentRepository->all(),
]);
}
/**
* Show the form to add new payment.
*
* @return Application|Factory|View
*/
public function create()
{
return view('payments.create', [
'checkins' => $this->checkinRepository->query()
->doesntHave('payments')->get(),
]);
}
/**
* Displays the payment addition form with the billing information.
*
* @param CheckIn $checkin
* @return Application|Factory|View
*/
public function createWithBilling(CheckIn $checkin)
{
return view('payments.create', [
'checkins' => $this->checkinRepository->all(),
'selectedCheckin' => $checkin,
'data' => $this->checkinService->getBillAmount($checkin)
]);
}
/**
* Add a new payment.
*
* @param Request $request
* @param CheckIn $checkin
* @return Application|RedirectResponse|Redirector
*/
public function store(Request $request, CheckIn $checkin)
{
$request->validate([
'discount' => 'nullable|numeric|min:0|max:1000000000',
'payer' => 'required|in:agent,customer'
]);
return $this->paymentService->create($request)
? redirect(route('payments.index'))->with('success', 'New payment added
successfully.')
: back()->with('error', 'New payment could not be added.');
}
/**
* Update a specific payment.
*
* @param Request $request
* @param Payment $payment
* @return Payment|RedirectResponse
*/
/**
* Delete a specific payment.
*
* @param Payment $payment
* @return Application|RedirectResponse|Redirector
*/
public function destroy(Payment $payment)
{
return $this->paymentService->delete($payment->id)
? redirect(route('payments.index'))->with('success', 'Payment deleted
successfuly.')
: redirect(route('payments.index'))->with('error', 'Failed to delete payment.');
}
}
Restaurant
<?php
namespace App\Http\Controllers;
use App\Http\Requests\StorePayment;
use App\Http\Requests\UpdatePayment;
use App\Models\CheckIn;
use App\Repositories\CheckIn\CheckInRepositoryInterface;
use App\Repositories\Payment\PaymentRepositoryInterface;
use App\Services\CheckIn\CheckInServiceInterface;
use App\Services\Payment\PaymentServiceInterface;
use App\Models\Payment;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
/**
* PaymentController constructor.
*
* @param PaymentRepositoryInterface $paymentRepository
* @param PaymentServiceInterface $paymentService
*/
/**
* Display the list of payments.
*
*/
public function index()
{
return view('payments.index', [
'payments' => $this->paymentRepository->all(),
]);
}
/**
* Show the form to add new payment.
*
* @return Application|Factory|View
*/
public function create()
{
return view('payments.create', [
'checkins' => $this->checkinRepository->query()
->doesntHave('payments')->get(),
]);
}
/**
* Displays the payment addition form with the billing information.
*
* @param CheckIn $checkin
* @return Application|Factory|View
*/
public function createWithBilling(CheckIn $checkin)
{
return view('payments.create', [
'checkins' => $this->checkinRepository->all(),
'selectedCheckin' => $checkin,
'data' => $this->checkinService->getBillAmount($checkin)
]);
}
/**
* Add a new payment.
*
* @param Request $request
* @param CheckIn $checkin
* @return Application|RedirectResponse|Redirector
*/
public function store(Request $request, CheckIn $checkin)
{
$request->validate([
'discount' => 'nullable|numeric|min:0|max:1000000000',
'payer' => 'required|in:agent,customer'
]);
return $this->paymentService->create($request)
? redirect(route('payments.index'))->with('success', 'New payment added
successfully.')
: back()->with('error', 'New payment could not be added.');
}
/**
* Update a specific payment.
*
* @param Request $request
* @param Payment $payment
* @return Payment|RedirectResponse
*/
/**
* Delete a specific payment.
*
* @param Payment $payment
* @return Application|RedirectResponse|Redirector
*/
public function destroy(Payment $payment)
{
return $this->paymentService->delete($payment->id)
? redirect(route('payments.index'))->with('success', 'Payment deleted
successfuly.')
: redirect(route('payments.index'))->with('error', 'Failed to delete payment.');
}
}
Role
<?php
namespace App\Http\Controllers;
use App\Forms\Role\Store;
use App\Forms\Role\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreRole;
use App\Http\Requests\UpdateRole;
use App\Repositories\Role\RoleRepositoryInterface;
use App\Services\Role\RoleServiceInterface;
use App\Models\Role;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Role as RoleResource;
use App\Http\Resources\RoleCollection;
/**
* RoleController constructor.
*
* @param RoleRepositoryInterface $roleRepository
* @param RoleServiceInterface $roleService
*/
public function construct(RoleRepositoryInterface $roleRepository,
RoleServiceInterface $roleService)
{
$this->roleRepository = $roleRepository;
$this->roleService = $roleService;
}
/**
* Display a listing of the role.
*
* @param Request $request
* @return Factory|View
* @throws \Exception
*/
public function index(Request $request)
{
$search = $request->search ?? '';
return view('uac.roles.index', [
'roles' => $this->roleRepository->all()
]);
}
/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}
/**
* Store a newly created role in storage.
*
* @param StoreRole $request
* @return RedirectResponse|Redirector
*/
public function store(StoreRole $request)
{
return $this->roleService->create($request)
? redirect(route('roles.index'))->with('success', 'New role created successfully.')
: back()->with('error', 'New role could not be created.');
}
/**
* Display the specified role.
*
* @param Role $role
* @return void
*/
public function show(Role $role)
{
abort(404);
}
/**
/**
* Update the specified role in storage.
*
* @param UpdateRole $request
* @param Role $role
* @return RedirectResponse|Redirector
*/
public function update(UpdateRole $request, Role $role)
{
return $this->roleService->update($request, $role->id)
? redirect(route('roles.index'))->with('success', 'Role updated successfully.')
: back()->with('error', 'The role could not be updated.');
}
/**
* Remove the specified role from storage.
*
* @param Role $role
* @return RedirectResponse|Redirector
*/
public function destroy(Role $role)
{
return $this->roleService->delete($role->id)
? redirect(route('roles.index'))->with('success', 'Role deleted successfully.')
: back()->with('error', 'The role could not be deleted.');
}
}
Room
<?php
namespace App\Http\Controllers;
use App\Forms\Room\Store;
use App\Forms\Room\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreRoom;
use App\Http\Requests\UpdateRoom;
use App\Repositories\Room\RoomRepositoryInterface;
use App\Services\Room\RoomServiceInterface;
use App\Models\Room;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Room as RoomResource;
use App\Http\Resources\RoomCollection;
/**
* RoomController constructor.
*
* @param RoomRepositoryInterface $roomRepository
* @param RoomServiceInterface $roomService
*/
public function construct(RoomRepositoryInterface $roomRepository,
RoomServiceInterface $roomService)
{
$this->roomRepository = $roomRepository;
$this->roomService = $roomService;
}
/**
* Display a listing of the room.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.rn', [
'records' => $this->roomRepository->all(),
'pageTitle' => 'Configuration',
'tableTitle' => 'Rooms',
'routePrefix' => 'rooms',
'label' => 'room'
]);
}
/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}
/**
* Store a newly created room in storage.
*
* @param StoreRoom $request
* @return RedirectResponse|Redirector
*/
public function store(StoreRoom $request)
{
return $this->roomService->create($request)
? redirect(route('rooms.index'))->with('success', 'New room created
successfully.')
: back()->with('error', 'New room could not be created.');
}
/**
* Display the specified room.
*
* @param Room $room
* @return void
*/
public function show(Room $room)
{
abort(404);
}
/**
* Display the form to update user.
*
* @param Room $room
* @return Factory|View
*/
public function edit(Room $room)
{
return view('components.form.index',
[ 'setup' => (new Update($room))-
>setup()
]);
}
/**
* Update the specified room in storage.
*
* @param UpdateRoom $request
* @param Room $room
* @return RedirectResponse|Redirector
*/
public function update(UpdateRoom $request, Room $room)
{
return $this->roomService->update($request, $room->id)
? redirect(route('rooms.index'))->with('success', 'Room updated successfully.')
: back()->with('error', 'The room could not be updated.');
}
/**
* Remove the specified room from storage.
*
* @param Room $room
* @return RedirectResponse|Redirector
*/
public function destroy(Room $room)
{
return $this->roomService->delete($room->id)
namespace App\Http\Controllers;
use App\Forms\RoomType\Store;
use App\Forms\RoomType\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreRoomType;
use App\Http\Requests\UpdateRoomType;
use App\Repositories\RoomType\RoomTypeRepositoryInterface;
use App\Services\RoomType\RoomTypeServiceInterface;
use App\Models\RoomType;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\RoomType as RoomTypeResource;
use App\Http\Resources\RoomTypeCollection;
protected $roomtypeRepository;
protected $roomtypeService;
/**
* RoomTypeController constructor.
*
* @param RoomTypeRepositoryInterface $roomtypeRepository
* @param RoomTypeServiceInterface $roomtypeService
*/
public function construct(RoomTypeRepositoryInterface $roomtypeRepository,
RoomTypeServiceInterface $roomtypeService)
{
$this->roomtypeRepository = $roomtypeRepository;
$this->roomtypeService = $roomtypeService;
}
/**
* Display a listing of the roomtype.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.ndp', [
'records' => $this->roomtypeRepository->all(),
'pageTitle' => 'Configuration',
'tableTitle' => 'Room Types',
'routePrefix' => 'roomtypes',
/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}
/**
* Store a newly created roomtype in storage.
*
* @param StoreRoomType $request
* @return RedirectResponse|Redirector
*/
public function store(StoreRoomType $request)
{
return $this->roomtypeService->create($request)
? redirect(route('roomtypes.index'))->with('success', 'New roomtype created
successfully.')
: back()->with('error', 'New roomtype could not be created.');
}
/**
* Display the specified roomtype.
*
* @param RoomType $roomtype
* @return void
*/
public function show(RoomType $roomtype)
{
abort(404);
}
/**
* Display the form to update user.
*
* @param RoomType $roomtype
* @return Factory|View
*/
public function edit(RoomType $roomtype)
{
return view('components.form.index', [
'setup' => (new Update($roomtype))->setup()
]);
}
/**
* Update the specified roomtype in storage.
*
/**
* Remove the specified roomtype from storage.
*
* @param RoomType $roomtype
* @return RedirectResponse|Redirector
*/
public function destroy(RoomType $roomtype)
{
return $this->roomtypeService->delete($roomtype->id)
? redirect(route('roomtypes.index'))->with('success', 'RoomType deleted
successfully.')
: back()->with('error', 'The roomtype could not be deleted.');
}
}
Service type
<?php
namespace App\Http\Controllers;
use App\Forms\Service\Store;
use App\Forms\Service\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreService;
use App\Http\Requests\UpdateService;
use App\Repositories\Service\ServiceRepositoryInterface;
use App\Services\Service\ServiceServiceInterface;
use App\Models\Service;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Service as ServiceResource;
use App\Http\Resources\ServiceCollection;
/**
* ServiceController constructor.
*
/**
* Display a listing of the service.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.ndp', [
'records' => $this->serviceRepository->all(),
'pageTitle' => 'Configuration',
'tableTitle' => 'Services',
'routePrefix' => 'services',
'label' => 'service'
]);
}
/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}
/**
* Store a newly created service in storage.
*
* @param StoreService $request
* @return RedirectResponse|Redirector
*/
public function store(StoreService $request)
{
return $this->serviceService->create($request)
? redirect(route('services.index'))->with('success', 'New service created
successfully.')
: back()->with('error', 'New service could not be created.');
}
/**
* Display the specified service.
*
* @param Service $service
* @return void
*/
public function show(Service $service)
{
abort(404);
}
/**
* Display the form to update user.
*
* @param Service $service
* @return Factory|View
*/
public function edit(Service $service)
{
return view('components.form.index', [
'setup' => (new Update($service))->setup()
]);
}
/**
* Update the specified service in storage.
*
* @param UpdateService $request
* @param Service $service
* @return RedirectResponse|Redirector
*/
public function update(UpdateService $request, Service $service)
{
/**
* Remove the specified service from storage.
*
* @param Service $service
* @return RedirectResponse|Redirector
*/
public function destroy(Service $service)
{
return $this->serviceService->delete($service->id)
? redirect(route('services.index'))->with('success', 'Service deleted successfully.')
: back()->with('error', 'The service could not be deleted.');
}
}
User
<?php
namespace App\Http\Controllers;
use App\Forms\Service\Store;
use App\Forms\Service\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreService;
use App\Http\Requests\UpdateService;
use App\Repositories\Service\ServiceRepositoryInterface;
use App\Services\Service\ServiceServiceInterface;
use App\Models\Service;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Service as ServiceResource;
use App\Http\Resources\ServiceCollection;
/**
* ServiceController constructor.
*
* @param ServiceRepositoryInterface $serviceRepository
* @param ServiceServiceInterface $serviceService
*/
public function construct(ServiceRepositoryInterface $serviceRepository,
ServiceServiceInterface $serviceService)
{
$this->serviceRepository = $serviceRepository;
$this->serviceService = $serviceService;
/**
* Display a listing of the service.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.ndp', [
'records' => $this->serviceRepository->all(),
'pageTitle' => 'Configuration',
'tableTitle' => 'Services',
'routePrefix' => 'services',
'label' => 'service'
]);
}
/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}
/**
* Store a newly created service in storage.
*
* @param StoreService $request
* @return RedirectResponse|Redirector
*/
public function store(StoreService $request)
{
return $this->serviceService->create($request)
? redirect(route('services.index'))->with('success', 'New service created
successfully.')
: back()->with('error', 'New service could not be created.');
}
/**
* Display the specified service.
*
* @param Service $service
* @return void
*/
public function show(Service $service)
{
abort(404);
}
/**
/**
* Update the specified service in storage.
*
* @param UpdateService $request
* @param Service $service
* @return RedirectResponse|Redirector
*/
public function update(UpdateService $request, Service $service)
{
return $this->serviceService->update($request, $service->id)
? redirect(route('services.index'))->with('success', 'Service updated
successfully.')
: back()->with('error', 'The service could not be updated.');
}
/**
* Remove the specified service from storage.
*
* @param Service $service
* @return RedirectResponse|Redirector
*/
public function destroy(Service $service)
{
return $this->serviceService->delete($service->id)
? redirect(route('services.index'))->with('success', 'Service deleted successfully.')
: back()->with('error', 'The service could not be deleted.');
}
}
Password
<?php
namespace App\Http\Controllers;
use App\Forms\User\ChangePassword;
use App\Http\Controllers\Controller;
use App\Http\Requests\PasswordChangeRequest;
use App\Models\User;
use App\Repositories\User\UserRepositoryInterface;
use App\Services\User\UserServiceInterface;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\View\View;
{
protected $userRepository;
protected $userService;
/**
* UserController constructor.
*
* @param UserRepositoryInterface $userRepository
* @param UserServiceInterface $userService
*/
public function construct(UserRepositoryInterface $userRepository,
UserServiceInterface $userService)
{
$this->userRepository = $userRepository;
$this->userService = $userService;
}
/**
* Shows the password change form.
*
* @param User $user
* @return Factory|View
*/
public function edit(User $user)
{
return view('components.form.index', [
'setup' => (new ChangePassword($user))->setup(),
]);
}
/**
* Updates the password of a user.
*
* @param PasswordChangeRequest $request
* @param User $user
* @return \Illuminate\Http\RedirectResponse
*/
public function update(PasswordChangeRequest $request, User $user)
{
return $this->userService->changePassword($request->password, $user->id)
? back()->with('success', 'Password changed successfully.')
: back()->with('error', 'Could not change password.');
}
/**
* Shows the password change form.
*
* @param User $user
* @return Factory|View
*/
public function editByUser()
{
return view('components.form.index', [
'setup' => (new ChangePassword(Auth::user()))->setup(),
]);
}
/**
* Updates the password of a user.
*
* @param PasswordChangeRequest $request
* @param User $user
* @return \Illuminate\Http\RedirectResponse
*/
public function updateByUser(PasswordChangeRequest $request)
{
return $this->userService->changePassword($request->password, Auth::id())
? back()->with('success', 'Password changed successfully.')
: back()->with('error', 'Could not change password.');
}
}
8.2.2 Kernel Code
<?php
namespace App\Http;
* @var array
*/
protected $middleware = [
\App\Http\Middleware\TrustProxies::class,
\App\Http\Middleware\CheckForMaintenanceMode::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' =>
[ 'throttle:60,
1',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' =>
\Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'bindings'
=> \Illuminate\Routing\Middleware\SubstituteBindings::class, 'cache.headers'
=> \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' =>
\Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' =>
\Illuminate\Auth\Middleware\RequirePassword::class, 'signed' =>
\Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' =>
\Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' =>
\Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
/**
* The priority-sorted list of middleware.
*
*
* @var array
*/
protected $middlewarePriority = [
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\Authenticate::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
];
}
8.2.3 Models codes:
Check-in
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
* @var array
*/
protected $fillable = [
'customer_id', 'agent_id', 'check_in_date', 'people_count', 'days', 'check_out'
];
/**
* Get the customer of the check in.
*
* @return BelongsTo
*/
public function customer()
{
return $this->belongsTo(Customer::class);
}
/**
* Get the rooms used for the check in.
*
* @return BelongsToMany
*/
public function rooms()
{
return $this->belongsToMany(Room::class, 'checkin_room', 'checkin_id', 'room_id')
->withPivot('released_on')
->withTimestamps();
/**
* Get the meal plans used for the check in.
*
* @return BelongsToMany
*/
public function meals()
{
return $this->belongsToMany(Meal::class, 'checkin_meal', 'checkin_id', 'meal_id')
->withPivot('quantity')
->withTimestamps();
}
/**
* Get the restaurant orders of the check in.
*
* @return BelongsToMany
*/
public function restaurantOrders()
{
return $this->belongsToMany(Food::class, 'restaurant_orders', 'checkin_id',
'food_id')
->withPivot('quantity', 'room_id')
->withTimestamps();
}
/**
* Get the laundry orders of the check in.
*
* @return BelongsToMany
*/
public function laundryOrders()
{
return $this->belongsToMany(Laundry::class, 'laundry_orders', 'checkin_id',
'laundry_id')
->withPivot('quantity', 'room_id')
->withTimestamps();
}
/**
* Get the payment for the checkin.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function payments()
{
return $this->hasMany(Payment::class, 'checkin_id');
}
/**
* Get the agent of the checkin.
*
* @return BelongsTo
*/
public function agent()
{
return $this->belongsTo(Agent::class);
}
}
Customer
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* Get the checkins of the customer.
*
* @return HasMany
*/
public function checkins()
{
return $this->hasMany(CheckIn::class);
}
}
Food
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
/**
* Attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
/**
* Get the orders for the check in.
*
* @return BelongsToMany
*/
public function restaurantOrders()
{
return $this->belongsToMany(CheckIn::class, 'restaurant_orders', 'food_id',
'checkin_id')
->withPivot('quantity', 'room_id')
->withTimestamps();
}
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
*/
protected $fillable = [
'name', 'description', 'price'
];
/**
* Get the orders for the check in.
*
* @return BelongsToMany
*/
public function laundryOrders()
{
return $this->belongsToMany(CheckIn::class, 'laundry_orders', 'laundry_id',
'checkin_id')
->withPivot('quantity', 'room_id')
->withTimestamps();
}
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\Pivot;
* @var string
*/
protected $table = 'laundry_orders';
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = true;
/**
* Appends with the json representation of model.
*
* @var array
*/
protected $appends = [ 'laundry', 'room'];
/**
* Return the instance of the laundry model.
*
* @return mixed
*/
public function getLaundryAttribute()
{
return Laundry::find($this->laundry_id);
}
/**
* Return the instance of the room model.
*
* @return mixed
*/
public function getRoomAttribute()
{
return Room::find($this->room_id);
}
}<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
/**
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* Checkin of the payment.
*
* @return BelongsTo
*/
public function checkin()
{
return $this->belongsTo(CheckIn::class);
}
}
Permission
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
/**
* Get all the roles related to the permission.
*
* @return BelongsToMany
*/
public function roles()
{
return $this->belongsToMany(Role::class);
}
}
Restaurant order
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\Pivot;
/**
* The table model is related to.
*
* @var string
*/
protected $table = 'restaurant_orders';
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = true;
/**
* Appends with the json representation of model.
*
* @var array
*/
protected $appends = [ 'food', 'room'];
/**
* Return the instance of the food model.
*
* @return mixed
*/
public function getFoodAttribute()
{
return Food::find($this->food_id);
}
/**
* Return the instance of the room model.
*
* @return mixed
*/
public function getRoomAttribute()
{
return Room::find($this->room_id);
}
}
Role
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
/**
* Get all the permissions related to the role.
*
* @return BelongsToMany
*/
public function permissions()
{
return $this->belongsToMany(Permission::class);
}
/**
* Get the users of the role.
*
* @return BelongsToMany
*/
public function users()
{
return $this->belongsToMany(User::class);
}
}
Room
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
/**
* Get the type of the room.
*
* @return BelongsTo
*/
public function roomType()
{
return $this->belongsTo(RoomType::class);
}
/**
* Get the check in records for the room.
*
* @return BelongsToMany
*/
public function checkins()
{
return $this->belongsToMany(CheckIn::class, 'checkin_room', 'room_id',
'checkin_id')
->withPivot('released_on')
->withTimestamps();
}
}
Room type
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
*
* @var array
*/
protected $fillable = [
'name', 'description', 'price'
];
/**
* Rooms belonging to the type.
*
* @return HasMany
*/
public function rooms()
{
return $this->hasMany(Room::class);
}
}
User
<?php
namespace App\Models;
use App\Traits\HasPermissions;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
{
use Notifiable, HasPermissions;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email','username', 'password', 'avatar', 'superadmin'
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden =
[ 'password',
'remember_token',
];
/**
* Find the user instance for the given username.
*
* @param string $username
* @return User
*/
public function findForPassport($username)
{
return $this->where('username', $username)->first();
}
/**
* Get the roles of the user.
*
* @return BelongsToMany
*/
public function roles()
{
return $this->belongsToMany(Role::class);
}
/**
* Gets the first role.
*
* @return mixed
*/
public function getRoleAttribute()
{
return $this->roles()->first();
}
The provided system is updated according to the present time but with time everything evolves
and maybe new features will be added in the hotel which is not implemented now but it is open
and change can be made easily even after many time.