@@ -10,7 +10,7 @@ Support Package For PHP and Laravel
1010* [ Installation] ( #installation )
1111* [ All Paths] ( #all-paths )
1212* [ Number to Words] ( #number-to-words )
13- * [ Iso ] ( #iso )
13+ * [ ISO ] ( #iso )
1414 * [ Cents] ( #Cents )
1515 * [ Value] ( #value )
1616 * [ toText] ( #toText )
@@ -49,10 +49,36 @@ Support Package For PHP and Laravel
4949 * [ exceptArray] ( #exceptArray )
5050 * [ replaceFirst] ( #replaceFirst )
5151 * [ replaceLast] ( #replaceLast )
52- * [ removeKeysFromArray ] ( #removeKeysFromArray )
53- * [ changeKeysFromArray ] ( #changeKeysFromArray )
54- * [ convertArrayKey ] ( #convertArrayKey )
52+ * [ renameArrayKeys ] ( #renameArrayKeys )
53+ * [ forgetArrayKeys ] ( #forgetArrayKeys )
54+ * [ changeKeyCase ] ( #changeKeyCase )
5555 * [ convertArrayCase] ( #convertArrayCase )
56+ * [ padLeft] ( #padLeft )
57+ * [ padRight] ( #padRight )
58+ * [ words] ( #words )
59+ * [ ascii] ( #ascii )
60+ * [ is] ( #is )
61+ * [ snake] ( #snake )
62+ * [ camel] ( #camel )
63+ * [ kebab] ( #kebab )
64+ * [ title] ( #title )
65+ * [ studly] ( #studly )
66+ * [ slugify] ( #slugify )
67+ * [ slug] ( #slug )
68+ * [ before] ( #before )
69+ * [ after] ( #after )
70+ * [ between] ( #between )
71+ * [ contains] ( #contains )
72+ * [ truncate] ( #truncate )
73+ * [ reverse] ( #reverse )
74+ * [ count] ( #count )
75+ * [ countOccurrences] ( #countOccurrences )
76+ * [ uuid] ( #uuid )
77+ * [ randomWords] ( #randomWords )
78+ * [ extension] ( #extension )
79+ * [ wrap] ( #wrap )
80+ * [ head] ( #head )
81+ * [ last] ( #last )
5682* [ Country] ( #country )
5783 * [ Usage] ( #country-usage )
5884 * [ iso3] ( #country-iso3 )
@@ -185,7 +211,7 @@ Support Package For PHP and Laravel
185211* [ PDF] ( #pdf )
186212 * [ Read PDF] ( #read-pdf )
187213* [ Time] ( #time )
188- * [ time-data ] ( #time-data )
214+ * [ time-usage ] ( #time-usage )
189215 * [ now] ( #now )
190216 * [ date] ( #date )
191217 * [ today] ( #today )
@@ -509,25 +535,95 @@ Tame()->formatNumberToNearestThousand(1500000);
509535
510536### Str Usage
511537
512- ### Methods
513- - replaceFirst · replaceLast · words · ascii · padLeft · is · exceptArray · convertArrayCase · flattenValue · bindings · formatString · formatOnlyString · phone · mask · html · text · shorten · random
514-
515538``` php
516539use Tamedevelopers\Support\Str;
517540
518- // Quick examples
519- Str::replaceFirst('foo', 'bar', 'foofoo'); // 'barfoo'
520- Str::words('The quick brown fox jumps', 3); // 'The quick brown...'
521- Str::ascii('Jürgen'); // 'Jurgen'
522- Str::padLeft('7', 3, '0'); // '007'
523- Str::is('user/*', 'user/42'); // true
524- Str::exceptArray(['a'=>1,'b'=>2], 'a'); // ['b'=>2]
525- Str::convertArrayCase(['Name' => ['Age' => 1]], 'lower', 'upper'); // ['name' => ['age' => 1]]
541+ // Replace first/last occurrence
542+ Str::replaceFirst('foo', 'bar', 'foofoo'); // 'barfoo'
543+ Str::replaceLast('foo', 'bar', 'foofoo'); // 'foobar'
544+
545+ // Word limiting & ASCII
546+ Str::words('The quick brown fox jumps', 3); // 'The quick brown...'
547+ Str::ascii('Jürgen'); // 'Jurgen'
548+
549+ // Padding
550+ Str::padLeft('7', 3, '0'); // '007'
551+ Str::padRight('7', 3, '0'); // '700'
552+
553+ // Pattern matching
554+ Str::is('user/*', 'user/42'); // true
555+ Str::contains('brown', 'The quick brown fox'); // true
556+
557+ // Case/format helpers
558+ Str::snake('Hello World'); // 'hello_world'
559+ Str::camel('hello world'); // 'helloWorld'
560+ Str::kebab('Hello World'); // 'hello-world'
561+ Str::title('hello world'); // 'Hello World'
562+ Str::studly('hello world'); // 'HelloWorld'
563+ Str::slug('Hello World!'); // 'hello-world'
564+ Str::slugify('À bientôt'); // 'a-bientot'
565+
566+ // Slicing
567+ Str::before('user:42', ':'); // 'user'
568+ Str::after('user:42', ':'); // '42'
569+ Str::between('a[core]z', '[', ']'); // 'core'
570+
571+ // Transformations
572+ Str::reverse('abc'); // 'cba'
573+ Str::truncate('lorem ipsum', 5); // 'lo...'
574+
575+ // Randoms
576+ Str::random(8); // 'a1B9...'
577+ Str::uuid(); // 'xxxxxxxx-xxxx-4xxx-...'
578+ Str::randomWords(3); // 'lor em ip'
579+
580+ // Arrays
581+ Str::exceptArray(['a'=>1,'b'=>2], 'a'); // ['b'=>2]
582+ Str::renameArrayKeys([['id'=>1]], 'id', 'user_id');// [['user_id'=>1]]
583+ Str::forgetArrayKeys(['a'=>1,'b'=>2], 'a'); // ['b'=>2]
584+ Str::bindings(['where'=>[1,2], 'join'=>[3]]); // [1,2,3]
585+ Str::flattenValue([[1,2],[3]]); // [1,2,3]
586+ Str::convertArrayCase(['Name'=>['Age'=>1]], 'lower', 'upper'); // ['name'=>['age'=>1]]
587+
588+ // Security/text helpers
589+ Str::phone('+1 (555) 123-4567'); // '+15551234567'
590+ Str::mask('1234567890', 4, 'right'); // '******7890'
591+ Str::html('< ; b> ; Hi< ; /b> ; '); // '<b >Hi</b >'
592+ Str::text('<b >Hi</b >'); // 'Hi'
593+ Str::shorten('Long sentence here', 10); // 'Long sente...'
594+ Str::encrypt('secret'); // encrypted
595+ Str::decrypt('...'); // original
596+ ```
597+
598+ ## Country
599+ - Country data and helpers
600+ - Class: ` Tamedevelopers\Support\Country `
601+ - It's helper class can be called, using -- ` TameCountry() `
602+
603+ ### Country Usage
604+
605+ - ISO codes and flags
606+ ``` php
607+ use Tamedevelopers\Support\Country;
608+
609+ Country::getCountryIso3('name');
610+ Country::getCountryIso2('name');
611+ Country::getCountryFlagIso3('name');
612+ Country::getCountryFlagIso2('name');
613+ ```
614+
615+ - Months, Weeks, Time Zones, Captcha Locale
616+ ``` php
617+ Country::getMonths('short');
618+ Country::getWeeks('mon');
619+ Country::getTimeZone('Europe/London');
620+ Country::getCaptchaLocale('en');
526621```
527622
528623## File
529624- The Core File utilities (read, write, copy, move, info).
530625 - Class: ` Tamedevelopers\Support\Capsule\File `
626+ - It's helper class can be called, using -- ` TameFile() `
531627
532628### File Usage
533629
@@ -688,6 +784,7 @@ TameZip()->download('newData.zip')
688784
689785## PDF
690786- Require package to be installed - ` composer require dompdf/dompdf `
787+ - It's helper class can be called, using -- ` TamePDF() `
691788
692789| options | Description |
693790| ----------------------- | -----------------------|
@@ -713,14 +810,6 @@ PDF::create([
713810 'output' => 'view',
714811]);
715812```
716- - or -- ` Helpers Function `
717- ```
718- TamePDF()->create([
719- 'content' => '<h1>Hello World!</h1>',
720- 'destination' => public_path("invoice/{$generate}"),
721- 'output' => 'save',
722- ]);
723- ```
724813
725814### Read PDF
726815- Takes one param as ` string `
@@ -733,16 +822,10 @@ This will read the PDF to the browser
733822```
734823
735824## Time
736- - Helper function is called using ` TameTime() `
737- - Visit the Tests/ folder to see more examples.
825+ - Class: ` \Tamedevelopers\Support\Time `
826+ - It's helper class can be called, using -- ` TameTime() `
738827
739- ```
740- use Tamedevelopers\Support\Time;
741-
742- $time = new Time('now', 'Africa/Lagos');
743- ```
744-
745- ### time-data
828+ ### Time Usage
746829- Get time date from class
747830
748831| function name | Description |
@@ -757,6 +840,8 @@ $time = new Time('now', 'Africa/Lagos');
757840| ` time() \| getTime() ` | Get time as int |
758841
759842```
843+ $time = new Time('now', 'Africa/Lagos');
844+
760845[
761846 $time4->time(),
762847 $time4->sec(),
@@ -927,6 +1012,8 @@ Time::getTimeZone();
9271012```
9281013
9291014## Cookie
1015+ - Class: ` \Tamedevelopers\Support\Cookie `
1016+ - It's helper class can be called, using -- ` TameCookie() `
9301017
9311018### Cookie Usage
9321019
@@ -950,7 +1037,7 @@ Time::getTimeZone();
9501037 - [ optional] ` $secure ` param as ` bool | null `
9511038 - [ optional] ` $httponly ` param as ` bool | null `
9521039
953- ```
1040+ ``` php
9541041use Tamedevelopers\Support\Cookie;
9551042
9561043Cookie::set('cookie_name', 'value');
@@ -959,7 +1046,7 @@ Cookie::set('cookie_name', 'value');
9591046### Get
9601047- Takes param as ` string `
9611048
962- ```
1049+ ``` php
9631050Cookie::get('cookie_name');
9641051```
9651052
@@ -969,22 +1056,22 @@ Cookie::get('cookie_name');
9691056 - [ optional] ` $path ` param as ` string | null `
9701057 - [ optional] ` $domain ` param as ` string | null `
9711058
972- ```
1059+ ``` php
9731060Cookie::forget('cookie_name');
9741061```
9751062
9761063### Has
9771064- Takes param as ` string `
9781065 - Returns ` bool `
9791066
980- ```
1067+ ``` php
9811068if(Cookie::has('cookie_name')){
9821069 // execute code
9831070}
9841071```
9851072
9861073- or -- ` Helpers Function `
987- ```
1074+ ``` php
9881075TameCookie()->set('user', '__user');
9891076```
9901077
0 commit comments