Return to homepage

Comments

sylvain

it was fun to learn this course

  • 0
Hamza

is it possible to show a whole calendar with all the appointment slots indicated?

  • 0
Marcel

Can someone guide me how to mix 2 different schedule for 1 employee, a AM + PM schedule for one specific day

  • 0
Angel

You need to create a new schedule with the start time from 09:00 to 18:00... Also, you need to be more clear about your requirement ;)

  • 0
Ian

In the create-booking-blade.php

For the disabled attribute, instead of having a ternary expression you make use of Laravel's @disabled() directive

For example, @disabled($employees->isEmpty())

Much cleaner than {{ $employees->isEmpty() ? 'disabled="disabled"' : '' }}

Docs: https://laravel.com/docs/9.x/blade#checked-and-selected

Same can be applied to classes (https://laravel.com/docs/9.x/blade#conditional-classes)

  • 0
Azman

What is the name of this database manager?

  • 0
Azman

Just saw that this question was asked and answered by another member :)

  • 0
Adrian

in 4:30, where did $this->unavailabilities came from? you didn't declare any protected property.. where it is located? sorry I'm newbie..

  • 0

Hi! Constructor Property Promotion is a new syntax in PHP 8 that allows class property declaration and constructor assignment right from the constructor. You can refer more it on google via "Constructor Property Promotion in php 8" keyword

  • 0
Adrian

Thank you so much!! This will really make coding much cleaner..

  • 0
Ashish

Awesome course 👍

If service has duration defined why don't you use that for Increment variable (e.g. 15 minutes) ?

how can i subtract extra sunday showing in calender?

  • 0
Matthew

Great course! Thank you.

  • 1
Joshua

I am glad to watch this course Please how about situation where users are in different time zone? How to approach this if you may

Thanks a lot

  • 0
Stef

Thanks for this course! yes, any insights re user time zones for this would be very helpful to me too.

  • 0
stephane

Hello to all, I have a problem in AppointmentFilter.php, I wrote :

class AppointmentFilter implements Filter { public function __construct(Collection $appointments) { $this->appointments = $appointments; }

1public function apply(TimeSlotGenerator $generator, CarbonPeriod $interval)
2{
3 $interval->addFilter(function($slot) use ($generator) {
4
5 foreach ($this->appointments as $appointment){
6
7 if (
8 $slot->between(
9
10 $appointment->date->setTimeFrom($appointment->start_time
11 ->subMinutes($generator->service->duration)),
12
13 $appointment->date->setTimeFrom($appointment->end_time)
14
15 )
16
17 )
18 {
19 return false;
20 }
21
22 }
23 return true;
24 });
25}

}

but at runtime I have the following message: Call to a member function setTimeFrom() on string (View: D:\www\bookings\resources\views\bookings\create.php)

However I have date in DATE format and start_time and end_time in TIME format. Has anyone ever had this problem? Do you know how to fix this? Thanks

  • 0
stephane

hi, need to do this and now it's OK:

  • 0
stephane

I saw my mistake :-(

in Appointment Model i wrote protected $casts = [ 'date' , 'start_time' , 'end_time', 'cancelled_at'];

Normaly i must wrote : protected $casts = [ 'date' => 'datetime', 'start_time' => 'datetime', 'end_time' => 'datetime', 'cancelled_at' => 'datetime'];

  • 0
Lee

Hi I have a problem with this The CreateBooking Controller

  • 0
hermie

Thanks for this tutorial.. :)

  • 0
alireza

is this course done?

  • 0
MARTIN

Alex, what is the name of the tool you use to manage the database in the video?

  • 0
Dan

TablePlus

  • 0
Ab

He's using Postico which is for PostgreSQL. TablePlus is great and gives you many more database types to work with.

  • 0
Martin

Hey Alex, just wanted to say thanks for the great course. I'm using a slightly different stack Laravel-inertia with VueJS but I'm able to translate this very well into what I need. Looking forward to completing this one.

  • 1
Joe

quick tip, in blade views, you can use @dump() to dump variables

  • 0
nestor

excellent course!

  • 0
ossama

A Tip: sometimes we need to protect livewire's frontend methods like wire:click="setDate('..')". This it may help you out.

You can use Crypt facade in Laravel with build in encrypt and decrypt methods and ending up the method in your controller with try and catch like this:

In your view:

1...
2wire:click="setDate(Crypt::encrypt($this->date))"
3...

In your component

1...
2 $value = $this->date;
3 
4 try {
5 $date = Crypt::decrypt($key);
6 // do your things
7 
8 } catch (DecryptException $e) {
9 return abort(422);
10 }
11...

To insure the incoming data is correct and encrypted.

  • 3
Adel

Alex why you do not set the Increment variable with the service duration on TimeSlotGenerator rather having a fixed incremental schedule every 15 minutes! the next booking should be after finishing the appointment session which will last for the duration

  • 0
Nico

Hi,

Does anyone know why this would work:

1<livewire:booking.booking-calendar :service="$this->selectedService" :employee="$this->selectedEmployee" :key="optional($this->selectedEmployee)->id" />

and not the below:

1@livewire('booking.booking-calendar', ['service' => $this->selectedService, 'employee' => $this->selectedEmployee, 'key' => optional($this->selectedEmployee)->id])

I would like use @livewire blade directive and not <livewire: tag syntax. Perhaps I made a type somewhere any guidance will be greatly appreciated.

  • 0
Nico

Solution:

1@livewire('booking.booking-calendar', ['service' => $this->selectedService, 'employee' => $this->selectedEmployee], key(optional($this->selectedEmployee)->id))
  • 0
Pawel

you dont need to use $this-> every time ($this->selectedService), just $selectedService

  • 0
Nico

Ah yes thank you for pointing that out Pawel.

  • 0
hi

hi alex, what about a default days and hours and brake for default? the employees have a works days all the time: Sunday - Thursday, at : 9:00-18:00, with a brake 12:00-13:00 and brake at 15:00-15:30 and its be default in employee every week

  • 1
Dan

Bump! Can you tell or record a new video on this subject, Alex? Regards

  • 0
Rust

You don't have to type always "clear" your can use CMD+K on your terminal to clear

  • 1
ossama

They don't do the same job CMD + K: Clear the terminal screen. clear command: Clear all the above content.

  • 0
Rust

For me they do the same thing

  • 0
ossama

Try to click CMD + K and scroll up. Do the same thing to clear command, and you'll see the difference

  • 0
ossama

Quick Tip: In Laravel ^8 you can do cascadeOnDelete() instead of onDelete('cascade') and both do the same job :)

  • 9
Alex

Nice, thanks!

  • 0
Lee

Alex What version of laravel are you using with this mate Because you following your code from the start

On the select service on the booking form

On the controller public $state = [ 'service' = null, ]

wire:model="state.serrvice"

Then {{ var_dump ($state) }}

Undefined variable state

Confused

  • 0
Prasad

your service spelling may be check that

  • 0
Cristian

Awesome series! I was seriously considering building something similar for a buddy of mine, your approach is a lot cooler and cleaner than mine would have been!

  • 1
John Robertson

I love these kinds of videos where we get to build from scratch! :D Thanks Alex!

  • 8
Francis

Could've used $slot->isPast()

  • 1
Alex

Great shout, didn’t know about this method. Thanks.

  • 0
Jeff

Really enjoying this course, and how simple your presentation is.

  • 1
Alex

Thanks Jeff

  • 0
Egor

👍👍👍

  • 0
Ruslan

That's superb, thanks!

  • 0