@@ -160,24 +160,24 @@ You can also set the participation status of an attendee:
160
160
161
161
``` php
162
162
Event::create()
163
- ->attendee('
[email protected] ', 'Ruben', ParticipationStatus::
accepted() )
163
+ ->attendee('
[email protected] ', 'Ruben', ParticipationStatus::
Accepted )
164
164
...
165
165
```
166
166
167
167
There are five participation statuses:
168
168
169
- - ` ParticipationStatus::accepted() `
170
- - ` ParticipationStatus::declined() `
171
- - ` ParticipationStatus::tentative() `
172
- - ` ParticipationStatus::needs_action() `
173
- - ` ParticipationStatus::delegated() `
169
+ - ` ParticipationStatus::Accepted `
170
+ - ` ParticipationStatus::Declined `
171
+ - ` ParticipationStatus::Tentative `
172
+ - ` ParticipationStatus::NeedsAction `
173
+ - ` ParticipationStatus::Delegated `
174
174
175
175
176
176
You can indicate that an attendee is required to RSVP to an event:
177
177
178
178
``` php
179
179
Event::create()
180
- ->attendee('
[email protected] ', 'Ruben', ParticipationStatus::
needs_action() , requiresResponse: true)
180
+ ->attendee('
[email protected] ', 'Ruben', ParticipationStatus::
NeedsAction , requiresResponse: true)
181
181
...
182
182
```
183
183
@@ -201,21 +201,21 @@ The status of an event can be set:
201
201
202
202
``` php
203
203
Event::create()
204
- ->status(EventStatus::cancelled() )
204
+ ->status(EventStatus::Cancelled )
205
205
...
206
206
```
207
207
208
208
There are three event statuses:
209
209
210
- - ` EventStatus::confirmed() `
211
- - ` EventStatus::cancelled() `
212
- - ` EventStatus::tentative() `
210
+ - ` EventStatus::Confirmed `
211
+ - ` EventStatus::Cancelled `
212
+ - ` EventStatus::Tentative `
213
213
214
- An event can be classified(` public ` , ` private ` , ` confidential ` ) as such:
214
+ An event can be classified(` Public ` , ` Private ` , ` Confidential ` ) as such:
215
215
216
216
``` php
217
217
Event::create()
218
- ->classification(Classification::private() )
218
+ ->classification(Classification::Private )
219
219
...
220
220
```
221
221
@@ -244,16 +244,16 @@ You can add an image as such:
244
244
Event::create()
245
245
->image('https://spatie.be/logo.svg')
246
246
->image('https://spatie.be/logo.svg', 'text/svg+xml')
247
- ->image('https://spatie.be/logo.svg', 'text/svg+xml', Display::badge() )
247
+ ->image('https://spatie.be/logo.svg', 'text/svg+xml', Display::Badge )
248
248
...
249
249
```
250
250
251
251
There are four different image display types:
252
252
253
- - ` Display::badge() `
254
- - ` Display::graphic() `
255
- - ` Display::fullsize() `
256
- - ` Display::thumbnail() `
253
+ - ` Display::Badge `
254
+ - ` Display::Graphic `
255
+ - ` Display::Fullsize `
256
+ - ` Display::Thumbnail `
257
257
258
258
You can add a sequence to an event as such:
259
259
@@ -348,7 +348,7 @@ You can manually add timezones to a calendar if desired as such:
348
348
349
349
``` php
350
350
$timezoneEntry = TimezoneEntry::create(
351
- TimezoneEntryType::daylight() ,
351
+ TimezoneEntryType::Daylight ,
352
352
new DateTime('23 march 2020'),
353
353
'+00:00',
354
354
'+02:00'
@@ -414,7 +414,7 @@ Event::create('Laracon Online')
414
414
Recurrence rules or RRule's in short, make it possible to add a repeating event in your calendar by describing when it repeats within an RRule. First, we have to create an RRule:
415
415
416
416
``` php
417
- $rrule = RRule::frequency(RecurrenceFrequency::daily() );
417
+ $rrule = RRule::frequency(RecurrenceFrequency::Daily );
418
418
```
419
419
420
420
This rule describes an event that will be repeated daily. You can also set the frequency to ` secondly ` , ` minutely ` , ` hourly ` , ` weekly ` , ` monthly ` or ` yearly ` .
@@ -423,95 +423,95 @@ The RRULE can be added to an event as such:
423
423
424
424
``` php
425
425
Event::create('Laracon Online')
426
- ->rrule(RRule::frequency(RecurrenceFrequency::monthly() ));
426
+ ->rrule(RRule::frequency(RecurrenceFrequency::Monthly ));
427
427
```
428
428
429
429
It is possible to finetune the RRule to your personal taste; let's have a look!
430
430
431
431
A RRule can start from a certain point in time:
432
432
433
433
``` php
434
- $rrule = RRule::frequency(RecurrenceFrequency::daily() )->starting(new DateTime('now'));
434
+ $rrule = RRule::frequency(RecurrenceFrequency::Daily )->starting(new DateTime('now'));
435
435
```
436
436
437
437
And stop at a certain point:
438
438
439
439
``` php
440
- $rrule = RRule::frequency(RecurrenceFrequency::daily() )->until(new DateTime('now'));
440
+ $rrule = RRule::frequency(RecurrenceFrequency::Daily )->until(new DateTime('now'));
441
441
```
442
442
443
443
It can only be repeated for a few times, 10 times for example:
444
444
445
445
``` php
446
- $rrule = RRule::frequency(RecurrenceFrequency::daily() )->times(10);
446
+ $rrule = RRule::frequency(RecurrenceFrequency::Daily )->times(10);
447
447
```
448
448
449
449
The interval of the repetition can be changed:
450
450
451
451
``` php
452
- $rrule = RRule::frequency(RecurrenceFrequency::daily() )->interval(2);
452
+ $rrule = RRule::frequency(RecurrenceFrequency::Daily )->interval(2);
453
453
```
454
454
455
455
When this event starts on Monday, for example, the next repetition of this event will not occur on Tuesday but Wednesday. You can do the same for all the frequencies.
456
456
457
457
It is also possible to repeat the event on a specific weekday:
458
458
459
459
``` php
460
- $rrule = RRule::frequency(RecurrenceFrequency::monthly() )->onWeekDay(
461
- RecurrenceDay::friday()
460
+ $rrule = RRule::frequency(RecurrenceFrequency::Monthly )->onWeekDay(
461
+ RecurrenceDay::Friday
462
462
);
463
463
```
464
464
465
465
Or on a specific weekday of a week in the month:
466
466
467
467
``` php
468
- $rrule = RRule::frequency(RecurrenceFrequency::monthly() )->onWeekDay(
469
- RecurrenceDay::friday() , 3
468
+ $rrule = RRule::frequency(RecurrenceFrequency::Monthly )->onWeekDay(
469
+ RecurrenceDay::Friday , 3
470
470
);
471
471
```
472
472
473
473
Or on the last weekday of a month:
474
474
475
475
``` php
476
- $rrule = RRule::frequency(RecurrenceFrequency::monthly() )->onWeekDay(
477
- RecurrenceDay::sunday() , -1
476
+ $rrule = RRule::frequency(RecurrenceFrequency::Monthly )->onWeekDay(
477
+ RecurrenceDay::Sunday , -1
478
478
);
479
479
```
480
480
481
481
You can repeat on a specific day in the month:
482
482
483
483
``` php
484
- $rrule = RRule::frequency(RecurrenceFrequency::monthly() )->onMonthDay(16);
484
+ $rrule = RRule::frequency(RecurrenceFrequency::Monthly )->onMonthDay(16);
485
485
```
486
486
487
487
It is even possible to give an array of days in the month:
488
488
489
489
``` php
490
- $rrule = RRule::frequency(RecurrenceFrequency::monthly() )->onMonthDay(
490
+ $rrule = RRule::frequency(RecurrenceFrequency::Monthly )->onMonthDay(
491
491
[5, 10, 15, 20]
492
492
);
493
493
```
494
494
495
495
Repeating can be done for certain months (for example only in the second quarter):
496
496
497
497
``` php
498
- $rrule = RRule::frequency(RecurrenceFrequency::monthly() )->onMonth(
499
- [RecurrenceMonth::april() , RecurrenceMonth::may() , RecurrenceMonth::june() ]
498
+ $rrule = RRule::frequency(RecurrenceFrequency::Monthly )->onMonth(
499
+ [RecurrenceMonth::April , RecurrenceMonth::May , RecurrenceMonth::June ]
500
500
);
501
501
```
502
502
503
503
Or just on one month only:
504
504
505
505
``` php
506
- $rrule = RRule::frequency(RecurrenceFrequency::monthly() )->onMonth(
507
- RecurrenceMonth::october()
506
+ $rrule = RRule::frequency(RecurrenceFrequency::Monthly )->onMonth(
507
+ RecurrenceMonth::October
508
508
);
509
509
```
510
510
511
511
It is possible to set the day when the week starts:
512
512
513
513
``` php
514
- $rrule = RRule::frequency(RecurrenceFrequency::monthly() )->weekStartsOn(
514
+ $rrule = RRule::frequency(RecurrenceFrequency::Monthly )->weekStartsOn(
515
515
ReccurenceDay::monday()
516
516
);
517
517
```
@@ -520,15 +520,15 @@ You can provide a specific date on which an event won't be repeated:
520
520
521
521
``` php
522
522
Event::create('Laracon Online')
523
- ->rrule(RRule::frequency(RecurrenceFrequency::daily() ))
523
+ ->rrule(RRule::frequency(RecurrenceFrequency::Daily ))
524
524
->doNotRepeatOn(new DateTime('05/16/2020 12:00:00'));
525
525
```
526
526
527
527
It is also possible to give an array of dates on which the event won't be repeated:
528
528
529
529
``` php
530
530
Event::create('Laracon Online')
531
- ->rrule(RRule::frequency(RecurrenceFrequency::daily() ))
531
+ ->rrule(RRule::frequency(RecurrenceFrequency::Daily ))
532
532
->doNotRepeatOn([new DateTime('05/16/2020 12:00:00'), new DateTime('08/13/2020 15:00:00')]);
533
533
```
534
534
@@ -601,7 +601,7 @@ A timezone consists of multiple entries where the time of the timezone changed r
601
601
602
602
``` php
603
603
$entry = TimezoneEntry::create(
604
- TimezoneEntryType::standard() ,
604
+ TimezoneEntryType::Standard ,
605
605
new DateTime('16 may 2020 12:00:00'),
606
606
'+00:00',
607
607
'+02:00'
@@ -622,7 +622,7 @@ An RRule for the entry can be given as such:
622
622
623
623
``` php
624
624
$entry = TimezoneEntry::create(...)
625
- ->rrule(RRule::frequency(RecurrenceFrequency::daily() ));
625
+ ->rrule(RRule::frequency(RecurrenceFrequency::Daily ));
626
626
```
627
627
628
628
In the end you can add an entry to a timezone:
@@ -704,10 +704,6 @@ It is possible to create your subcomponents by extending the `Component` class.
704
704
composer test
705
705
```
706
706
707
- ### Alternatives
708
-
709
- We strive for a simple and easy to use API. Want something more? Then check out this [ package] ( https://github.com/markuspoerschke/iCal ) by Markus Poerschke.
710
-
711
707
### Changelog
712
708
713
709
Please see [ CHANGELOG] ( CHANGELOG.md ) for more information on what has changed recently.
0 commit comments