Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

pordonez's avatar

How to change weekstart to Friday and weekend to Thursday sitewide?

Hi All,

im planning to change my weekstart to Friday and weekend to Thursday for my spa business.

can someone walk me through on how to accomplish this?..

Thanks,

0 likes
8 replies
jaythanki's avatar

@PORDONEZ is it fix for whole function in your current case than you can do

Carbon::now() = current utc time (2018-10-04 07:22:24) // this is for example when i run this in my local machine. It may be differ when you try this in your local machine.

$startOfWeek = Carbon\Carbon::now()->startOfWeek()->addDay(4);
$endOfWeek = Carbon\Carbon::now()->startOfWeek()->addDay(3);

hope this will help.

Vilfago's avatar

In your App/Providers/AppServiceProvider.php you can add in boot method :

Carbon::setWeekStartsAt(Carbon::FRIDAY);
Carbon::setWeekEndsAt(Carbon::THURSDAY);

You can also change Week-end if needed :

Carbon::setWeekendDays([
    Carbon::SUNDAY,
    Carbon::MONDAY,
]);
1 like
pordonez's avatar

@Vilfago tried doing this

Carbon::setWeekStartsAt(Carbon::FRIDAY);
Carbon::setWeekEndsAt(Carbon::THURSDAY);

how can i check on the view if the changes is already implemented, today is Thursday here in the Philippines so when i will check the number day it should be 0 or 1. correct?

Vilfago's avatar

should be 6 or 7 as it's the end of the week.

pordonez's avatar

@Vilfago oh yeah correct. but when i use this on my controller

$day = Carbon::now()->format( 'N' );

and this on my view

{{ $day }}

the result is 4

Vilfago's avatar

Did you add a use Illuminate\Support\Carbon; at the top of AppServiceProvider ?

Please or to participate in this conversation.