@@ -381,8 +381,8 @@ NumberToWords::value('twelve million three hundred thousand, six hundred and nin
381381- The Core Class of Components
382382 - It's helper class can be called, using -- ` Tame() `
383383
384- ```
385- Tamedevelopers\Support\Tame
384+ ``` php
385+ use Tamedevelopers\Support\Tame;
386386```
387387
388388### byteToUnit
@@ -696,7 +696,7 @@ $even = (new Collection([1,2,3,4]))->filter(fn($v) => $v % 2 === 0)->all(); // [
696696- The Core Class/Wrapper For ` PHPMailer `
697697 - It's helper class can be called, using -- ` TameMail() `
698698
699- ```
699+ ``` php
700700Tamedevelopers\Support\Mail
701701
702702Mail::to('email@example.com')
@@ -708,20 +708,18 @@ Mail::to('email@example.com')
708708### to
709709- Accepts multiple emails as ` array|string `
710710
711- ```
711+ ``` php
712712Mail::to('email@example.com')
713713
714714Mail::to(['email@example.com', 'email2@example.com'])
715715
716716Mail::to('email@example.com', 'email2@example.com', 'email3@example.com')
717-
718- Mail::to('email@example.com, email2@example.com')
719717```
720718
721719### attach
722720- Accepts multiple complex data as attachment as ` array|string `
723721
724- ```
722+ ``` php
725723Mail::attach(public_path("image.png"), 'New File Name')
726724
727725Mail::attach(['path' => public_path("image.png"), 'as' => 'New name'])
@@ -736,24 +734,23 @@ Mail::attach([
736734### subject
737735- Accepts mandatory ` string `
738736
739- ```
737+ ``` php
740738Mail::subject('subject');
741739```
742740
743741### body
744742- Accepts mandatory ` string `
745743
746- ```
744+ ``` php
747745Mail::subject('body');
748746```
749747
750748### send
751749- Accepts [ optional] closure/function
752750
753- ```
751+ ``` php
754752Mail::to('email@example.com')->send();
755753
756-
757754Mail::to('email@example.com')->send(function($reponse){
758755
759756 // $reponse
@@ -763,37 +760,37 @@ Mail::to('email@example.com')->send(function($reponse){
763760### flush
764761- Accepts mandatory ` bool ` Default value is false
765762 - Clear buffers and send email in the background without waiting (But only to be used when using an API/Submitting via Ajax/Fetch or similar method of form submission)
766- ```
763+ ``` php
767764Mail::to('email@example.com')
768- ->body('<p>Body Text</p>)
765+ ->body('<p >Body Text</p >' )
769766 ->flush(true)
770767 ->send();
771768```
772769
773770## Zip
774771- Takes two param as ` string `
775- - [ sourcePath] relative path of zip-file
776- - [ destination] relative folder path to save zip file
772+ - [ sourcePath] path to zip-directory
773+ - [ destination] path to save zip file
777774
778- ```
775+ ``` php
779776TameZip()->zip('app/Http', 'app.zip')
780777```
781778
782779### Unzip
783780- Takes two param as ` string `
784- - [ sourcePath] relative path of zip-file
785- - [ destination] relative folder path to unzip-file
781+ - [ sourcePath] path of zip-file
782+ - [ destination] path to unzip-directory
786783
787- ```
788- TameZip()->unzip('newData.zip', '/ public/zip')
784+ ``` php
785+ TameZip()->unzip('newData.zip', base_path(' public/zip') )
789786```
790787
791788### Zip Download
792789- Takes two param as ` string | boolean `
793- - [ fileName] relative path of zip-file
790+ - [ fileName] path of zip-file
794791 - [ unlink] Default is ` true ` unlinks file after download
795792
796- ```
793+ ``` php
797794TameZip()->download('newData.zip')
798795```
799796
@@ -816,7 +813,7 @@ TameZip()->download('newData.zip')
816813
817814### PDF Usage
818815
819- ```
816+ ``` php
820817Tamedevelopers\Support\PDF
821818
822819$generate = strtotime('now') . '.pdf';
@@ -832,10 +829,10 @@ PDF::create([
832829- Takes one param as ` string `
833830 - [ path] absolute path to PDF file
834831
835- ```
832+ ``` php
836833TamePDF()->read('invoice100.pdf')
837834
838- This will read the PDF to the browser
835+ // This will read the PDF to the browser
839836```
840837
841838## Time
@@ -856,7 +853,7 @@ This will read the PDF to the browser
856853| ` year() \| getYear() ` | Get years |
857854| ` time() \| getTime() ` | Get time as int |
858855
859- ```
856+ ``` php
860857$time = new Time('now', 'Africa/Lagos');
861858
862859[
@@ -873,13 +870,13 @@ $time = new Time('now', 'Africa/Lagos');
873870
874871### now
875872- Returns the Time Object with current timestamp of ` now `
876- ```
873+ ``` php
877874$time->now()->format()
878875```
879876
880877### date
881878- Accepts one param as (time) ` int|string `
882- ```
879+ ``` php
883880$time->date("first day of this month")->toDateTimeString()
884881```
885882
@@ -889,7 +886,7 @@ $time->date("first day of this month")->toDateTimeString()
889886### yesterday
890887- Thesame as ` now() ` with timestamp of ` yesterday `
891888
892- ```
889+ ``` php
893890$time->today();
894891$time->yesterday();
895892```
@@ -898,7 +895,7 @@ $time->yesterday();
898895- Accepts two parameter [ date, format]
899896 - only [ date] is mandatory and returns the Time(object)
900897
901- ```
898+ ``` php
902899$time->createFromFormat('24 Jan 2025 14:00:00', 'm/d/Y h:ia');
903900// object(Tamedevelopers\Support\Time)
904901```
@@ -907,15 +904,15 @@ $time->createFromFormat('24 Jan 2025 14:00:00', 'm/d/Y h:ia');
907904- Accepts two parameter [ date, format]
908905 - only [ date] is mandatory and returns formated timestamp
909906
910- ```
907+ ``` php
911908$time->timestamp('24 Jan 2025 14:00:00');
912909// Output: 2025-01-24 14:00:00
913910```
914911
915912### toJsTimer
916913- Accept one parameter as [ date] . Returns formated javascript timestamp
917914
918- ```
915+ ``` php
919916$time->toJsTimer('24 Jan 2025 14:00:00');
920917$time->jsTimer('24 Jan 2025 14:00:00');
921918// Output: Jan 24, 2025 14:00:00
@@ -929,15 +926,15 @@ $time->jsTimer('24 Jan 2025 14:00:00');
929926| -----------------------------------------------------------|
930927| ` year \| month \| hour \| mins \| sec \| days \| weeks ` |
931928
932- ```
929+ ``` php
933930$time->date('last year december')->diff('month');
934931// Output: 1
935932```
936933
937934### diffBetween
938935- Takes three paramater as ` firstDate \| lastDate \| mode ` . Thesame as diff.
939936
940- ```
937+ ``` php
941938$time->diffBetween('last year december', 1737752400, 'weeks');
942939// Output: 4
943940```
@@ -949,11 +946,12 @@ $time->diffBetween('last year december', 1737752400, 'weeks');
949946| ------------------------------------------------------------------------|
950947| ` full \| short \| duration \| time \| date \| date_time \| time_stamp ` |
951948
952- ```
949+ ``` php
953950$time->date('today')->ago()
954951$time->date('today')->timeAgo()
955952
956- // Output: [
953+ // Output:
954+ [
957955 "full" => "4 hours ago"
958956 "short" => "4h"
959957 "duration" => 4
@@ -968,7 +966,7 @@ $time->date('today')->timeAgo()
968966- Build date range according to value given
969967 - Accepts (2) params ` value and format `
970968
971- ```
969+ ``` php
972970$time->range('0-10', 'D, M j')
973971// Output: returns class of Tamedevelopers\Support\Capsule\TimeHelper
974972```
@@ -977,7 +975,7 @@ $time->range('0-10', 'D, M j')
977975- To get the output, we need to call the TimeHelper format method
978976 - The format() method takes two [ optional] param. ` start, year ` as boolean
979977
980- ```
978+ ``` php
981979$time->range('0-10')->format(true, true)
982980// Output: Thu, Jan 23 - Tue, Mar 4, 2025
983981
@@ -988,34 +986,34 @@ $time->range('0-10')->format()
988986### addSeconds
989987- Can be called using boht [ plural|singular] formats. To add more dates with already existing time.
990988
991- ```
989+ ``` php
992990$time4->now()->addMonth(3)->addSeconds(2)->addDays(2)->format()
993991```
994992
995993### subSeconds
996994- Can be called using boht [ plural|singular] formats. To subtract dates from already existing time.
997995
998- ```
996+ ``` php
999997$time4->now()->subMonth(3)->subSecond(2)->subDays(2)->format()
1000998```
1001999
10021000### allTimezone
1003- ```
1001+ ``` php
10041002Time::allTimezone();
10051003```
10061004
10071005### setTimeZone
1008- ```
1006+ ``` php
10091007Time::setTimeZone('Pacific/Pago_Pago');
10101008```
10111009
10121010### getTimeZone
1013- ```
1011+ ``` php
10141012Time::getTimeZone();
10151013```
10161014
10171015## UrlHelper
1018- ```
1016+ ``` php
10191017[
10201018 urlHelper()->server(),
10211019 urlHelper()->url(),
@@ -1233,6 +1231,13 @@ Samples
12331231
12341232@include('layout.partials.footer', ['year' => 2025])
12351233@yield('content')
1234+
1235+ @foreach($condition as $value)
1236+ @endforeach
1237+
1238+ @if($condition)
1239+ @else
1240+ @endif
12361241```
12371242
12381243### View Helper
@@ -1283,12 +1288,12 @@ Env::loadOrFail('path_to_env_folder')
12831288- Returns ` true|false ` . Used to update env variables
12841289 - It's helper class can be called, using -- ` env_update() `
12851290
1286- | Params | Description |
1287- | --------------- | -------------------|
1288- | key | ENV key |
1289- | value | ENV value |
1290- | allow_quote | ` true \| false ` - Default is true (Allow quotes within value) |
1291- | allow_space | ` true \| false ` - Default is false (Allow space between key and value) |
1291+ | Params | Description |
1292+ | ---------| -------------------|
1293+ | key | ENV key |
1294+ | value | ENV value |
1295+ | quote | ` true \| false ` - Default is true (Allow quotes within value) |
1296+ | space | ` true \| false ` - Default is false (Allow space between key and value) |
12921297
12931298``` php
12941299use Tamedevelopers\Support\Env;
0 commit comments