Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CakeFest 2025 Workshop 1

CakeFest 2025 Workshop 1

We are going to create an application from scratch using an Hotel Reservations System as a guiding example.

https://cakefest.org

Avatar for Jorge M. González Martín

Jorge M. González Martín

October 08, 2025
Tweet

Transcript

  1. Workshop 1 • ~2h session • Quick CakePHP project setup

    • Building an Hotel Reservation System with a twist • Code https:/ /github.com/steinkel/cakefest2025 • Database https:/ /github.com/steinkel/cakefest2025/blob/main/db.sql • Slides https:/ /speakerdeck.com/steinkel/cakefest-2025-workshop-1
  2. Setup dev environment • Requirements $ sudo apt install -y

    php-cli php-intl php-mbstring php-sqlite3 zip php-zip // setup composer 5
  3. Composer • Create a CakePHP 5 project • https:/ /github.com/cakephp/app

    $ composer create-project cakephp/app cakefest2025 Installing... … Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? ←Y {skeleton} 7
  4. Configure ddev $ ddev config # edit .ddev/config.yml file $

    ddev add-on list # install phpmyadmin 8
  5. Configuration • Application class • CakePHP Bootstrap • config/bootstrap.php •

    config/app.php • Configure default datasource via environment (done for you by ddev in .env) 9
  6. Hotel Reservation System • An example application • Play with

    the MVC stack • Deal with the ORM and build queries • Implement a "walk in" reservation flow
  7. $ bin/cake bake all --everything --prefix Admin (you will need

    to setup Admin prefix routing) Bake Shell • Build a CRUD for our tables 12
  8. Navigate our admin app 13 • Simple, but effective CRUD

    interface, pagination and links • Validate booking statuses • Improve room display
  9. • Create a new controller • Create a GET Form

    • Start filtering only by city name Hotel search 17
  10. • Create a command to send upcoming reservation emails to

    customers Sending emails & commands 26
  11. • New feature: Booking groups • BookingGroups can be created,

    and they are unique in each Hotel. • Bookings can belong to 1 group (optional) • We want to list all the bookings for a given group, and view which ones did checking already Build together! 31
  12. • Tweak the plugin configuration via Events • Add a

    staff dashboard Add new "staff" role 34
  13. • Use Authorization to filter the results for an index

    query Staff scoped bookings index 35