it was fun to learn this course
is it possible to show a whole calendar with all the appointment slots indicated?
yes plz
Can someone guide me how to mix 2 different schedule for 1 employee, a AM + PM schedule for one specific day
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 ;)
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)
What is the name of this database manager?
Just saw that this question was asked and answered by another member :)
in 4:30, where did $this->unavailabilities came from? you didn't declare any protected property.. where it is located? sorry I'm newbie..
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
Thank you so much!! This will really make coding much cleaner..
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?
Great course! Thank you.
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
Thanks for this course! yes, any insights re user time zones for this would be very helpful to me too.
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( 910 $appointment->date->setTimeFrom($appointment->start_time11 ->subMinutes($generator->service->duration)),1213 $appointment->date->setTimeFrom($appointment->end_time)1415 )1617 )18 {19 return false;20 }2122 }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
hi, need to do this and now it's OK:
appointments = $appointments; } public function apply(TimeSlotGenerator $generator, CarbonPeriod $interval) { $interval->addFilter(function ($slot) use ($generator) { foreach ($this->appointments as $appointment) { $dtd = new Carbon($appointment->date . ' 00:00:00.0'); $dtd->setTimezone('Europe/Paris'); $dtd->setTimeFrom( $appointment->start_time); $dtd->subMinutes(($generator->service->duration- $generator::INCREMENT)); $dtf = new Carbon($appointment->date . ' 00:00:00.0'); $dtf->setTimezone('Europe/Paris'); $dtf->setTimeFrom( $appointment->end_time); $dtf->subMinutes($generator::INCREMENT); if ( $slot->between($dtd,$dtf) ) { return false; } } return true; }); } }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'];
Hi I have a problem with this The CreateBooking Controller
'', ]; public function createbooking($readingid) { $this->state; $services = Service::where('id', $readingid)->get(); return view('livewire.create-booking',[ 'services' => $services, ]); } } The create-booking form {{var_dump($state)}}Thanks for this tutorial.. :)
is this course done?
Alex, what is the name of the tool you use to manage the database in the video?
TablePlus
He's using Postico which is for PostgreSQL. TablePlus is great and gives you many more database types to work with.
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.
quick tip, in blade views, you can use @dump()
to dump variables
excellent course!
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.
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
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
Bump! Can you tell or record a new video on this subject, Alex? Regards
You don't have to type always "clear" your can use CMD+K on your terminal to clear
They don't do the same job
CMD + K
: Clear the terminal screen.
clear
command: Clear all the above content.
For me they do the same thing
Try to click CMD + K
and scroll up. Do the same thing to clear
command, and you'll see the difference
Quick Tip:
In Laravel ^8
you can do cascadeOnDelete()
instead of onDelete('cascade')
and both do the same job :)
Nice, thanks!
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
your service spelling may be check that
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!
I love these kinds of videos where we get to build from scratch! :D Thanks Alex!
Could've used $slot->isPast()
Great shout, didn’t know about this method. Thanks.
Really enjoying this course, and how simple your presentation is.
Thanks Jeff
👍👍👍
That's superb, thanks!
@alex If I do every service 90 min And interval is 90 min Add add a break 12-12:30 The time slots didn’t good I start the new slot in 13:30 and didn’t the end of the break 12:30