Skip to content

Commit e255fc9

Browse files
update
1 parent c5f36bf commit e255fc9

File tree

5 files changed

+58
-17
lines changed

5 files changed

+58
-17
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
/.idea
44
/.vscode
55
/.github
6+
/.env
7+
/.env.example
68
composer.lock

Mail.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,11 @@ private function __obFlush(?array $options = [])
417417
// Flush email sending queue
418418
if ($options['flush'] && $options['debug'] === 0) {
419419
if (!headers_sent()) {
420-
// @header('Surrogate-Control: BigPipe/1.0');
421-
// @header('X-Accel-Buffering: no');
422-
// @header("Content-Encoding: none");
423-
// @header("Connection: close");
424-
// @header("Content-Length: " . ob_get_length());
425-
426-
// $this->obFlush();
420+
@header('Surrogate-Control: BigPipe/1.0');
421+
@header('X-Accel-Buffering: no');
422+
@header("Content-Encoding: none");
423+
@header("Connection: close");
424+
@header("Content-Length: " . ob_get_length());
427425
}
428426
}
429427

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Support Package For PHP and Laravel
122122
* [Asset config](#asset-config)
123123
* [Asset Cache](#asset-cache)
124124
* [Env](#env)
125+
* [Env Create](#env-create)
125126
* [Env Load](#env-load)
126127
* [Env Update](#env-update)
127128
* [Server](#server)
@@ -673,6 +674,20 @@ $time->range('0-10')->format()
673674
// Output: Tue, Mar 4
674675
```
675676

677+
### addSeconds
678+
- Can be called using boht [plural|singular] formats. To add more dates with already existing time.
679+
680+
```
681+
$time4->now()->addMonth(3)->addSeconds(2)->addDays(2)->format()
682+
```
683+
684+
### subSeconds
685+
- Can be called using boht [plural|singular] formats. To subtract dates from already existing time.
686+
687+
```
688+
$time4->now()->subMonth(3)->subSecond(2)->subDays(2)->format()
689+
```
690+
676691
### allTimezone
677692
```
678693
Time::allTimezone();
@@ -851,6 +866,15 @@ asset_config('storage/style.css', true, true);
851866
- By default it use the default root as `.env` path, so mandatory to install vendor in root directory.
852867

853868

869+
### ENV Create
870+
- To create an environment `.env` file. Create or ignore if exists
871+
872+
```
873+
use Tamedevelopers\Support\Env;
874+
875+
Env::createOrIgnore()
876+
```
877+
854878
### ENV Load
855879
- To load the environment `.env` file
856880
- Takes optional param as `string` $path

Tests/mail.php

+15-10
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,21 @@
55
require_once __DIR__ . '/../vendor/autoload.php';
66

77

8+
$env = TameEnv();
9+
10+
// $env->createOrIgnore();
11+
// $env->load();
12+
13+
14+
// config mail manually here or .env file
815
$mailer = Mail::config([
9-
'host' => 'sandbox.smtp.mailtrap.io',
10-
'port' => 2525,
11-
'username' => '19e021f96b1434',
12-
'password' => 'ac7fc974df4844',
13-
'encryption' => 'ssl',
14-
'from_email' => 'noreply@mailtrap.io',
15-
'from_name' => 'Tame Developers',
16+
// 'host' => 'sandbox.smtp.mailtrap.io',
17+
// 'port' => 2525,
18+
// 'username' => '19e021f96b1434',
19+
// 'password' => 'ac7fc974df4844',
20+
// 'encryption' => 'ssl',
21+
// 'from_email' => 'noreply@mailtrap.io',
22+
// 'from_name' => 'Tame Developers',
1623
]);
1724

1825
$mailer->to('tamedevelopers@gmail.com')
@@ -23,9 +30,7 @@
2330
'New Name'
2431
)
2532
->send(function($response){
26-
// dd(
27-
// $response
28-
// );
33+
//
2934
});
3035

3136

helpers.php

+12
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ function TameMail()
6666
}
6767
}
6868

69+
if (! function_exists('TameEnv')) {
70+
/**
71+
* Env Object
72+
* @param mixed $path
73+
* @return \Tamedevelopers\Support\Env
74+
*/
75+
function TameEnv($path = null)
76+
{
77+
return new Env($path);
78+
}
79+
}
80+
6981
if (! function_exists('TameCookie')) {
7082
/**
7183
* Cookie Object

0 commit comments

Comments
 (0)