-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,404 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace App\Entities\Setting; | ||
|
||
abstract class AbstractSettingEntity | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<?php | ||
|
||
namespace App\Entities\Setting; | ||
|
||
use App\Entities\Setting\AbstractSettingEntity; | ||
|
||
class MailSettingEntity extends AbstractSettingEntity | ||
{ | ||
protected $driver; | ||
|
||
protected $from; | ||
|
||
protected $smtpHost; | ||
|
||
protected $smtpPort; | ||
|
||
protected $smtpEncryption; | ||
|
||
protected $smtpUsername; | ||
|
||
protected $smtpPassword; | ||
|
||
protected $sendmailPath; | ||
|
||
public function getDriver() | ||
{ | ||
return $this->driver; | ||
} | ||
|
||
public function getFrom() | ||
{ | ||
return $this->from; | ||
} | ||
|
||
public function getSmtpHost() | ||
{ | ||
return $this->smtpHost; | ||
} | ||
|
||
public function getSmtpPort() | ||
{ | ||
return $this->smtpPort; | ||
} | ||
|
||
public function getSmtpEncryption() | ||
{ | ||
return $this->smtpEncryption; | ||
} | ||
|
||
public function getSmtpUsername() | ||
{ | ||
return $this->smtpUsername; | ||
} | ||
|
||
public function getSmtpPassword() | ||
{ | ||
return $this->smtpPassword; | ||
} | ||
|
||
public function getSendmailPath() | ||
{ | ||
return $this->sendmailPath; | ||
} | ||
|
||
public function setDriver($driver) | ||
{ | ||
$this->driver = $driver; | ||
|
||
return $this; | ||
} | ||
|
||
public function setFrom(array $from) | ||
{ | ||
$this->from = $from; | ||
|
||
return $this; | ||
} | ||
|
||
public function setSmtpHost($smtpHost) | ||
{ | ||
$this->smtpHost = $smtpHost; | ||
|
||
return $this; | ||
} | ||
|
||
public function setSmtpPort($smtpPort) | ||
{ | ||
$this->smtpPort = $smtpPort; | ||
|
||
return $this; | ||
} | ||
|
||
public function setSmtpEncryption($smtpEncryption) | ||
{ | ||
$this->smtpEncryption = $smtpEncryption; | ||
|
||
return $this; | ||
} | ||
|
||
public function setSmtpUsername($smtpUsername) | ||
{ | ||
$this->smtpUsername = $smtpUsername; | ||
|
||
return $this; | ||
} | ||
|
||
public function setSmtpPassword($smtpPassword) | ||
{ | ||
$this->smtpPassword = $smtpPassword; | ||
|
||
return $this; | ||
} | ||
|
||
public function setSendmailPath($sendmailPath) | ||
{ | ||
$this->sendmailPath = $sendmailPath; | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
use App\Http\Requests; | ||
use App\Http\Controllers\Controller; | ||
use App\Services\Form\Setting\MailSettingForm; | ||
use App\Repositories\Setting\MailSettingInterface; | ||
|
||
class SettingsController extends Controller | ||
{ | ||
public function __construct() | ||
{ | ||
$this->middleware('auth'); | ||
$this->middleware('acl'); | ||
} | ||
|
||
public function getEmail(MailSettingInterface $mailSettingRepository) | ||
{ | ||
$settings = $mailSettingRepository->all(); | ||
|
||
return view('settings.email') | ||
->with('settings', $settings); | ||
} | ||
|
||
public function postEmail(Request $request, MailSettingForm $mailSettingForm) | ||
{ | ||
$input = $request->all(); | ||
|
||
if ($mailSettingForm->update($input)) { | ||
return redirect()->route('settings.email'); | ||
} else { | ||
return redirect()->route('settings.email') | ||
->withInput() | ||
->withErrors($mailSettingForm->errors()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace App\Repositories; | ||
|
||
use App\Services\Config\ConfigReaderInterface; | ||
use App\Services\Config\ConfigWriterInterface; | ||
|
||
abstract class AbstractConfigRepository implements RepositoryInterface | ||
{ | ||
protected $reader; | ||
|
||
protected $writer; | ||
|
||
/** | ||
* Create a new repository instance. | ||
* | ||
* @param \App\Services\Config\ConfigReaderInterface $reader | ||
* @param \App\Services\Config\ConfigWriterInterface $writer | ||
* @return void | ||
*/ | ||
public function __construct(ConfigReaderInterface $reader, ConfigWriterInterface $writer) | ||
{ | ||
$this->reader = $reader; | ||
$this->writer = $writer; | ||
} | ||
|
||
public function byId($id) | ||
{ | ||
} | ||
|
||
public function byPage($page = 1, $limi = 10) | ||
{ | ||
} | ||
|
||
public function all() | ||
{ | ||
} | ||
|
||
public function create(array $data) | ||
{ | ||
} | ||
|
||
public function update(array $data) | ||
{ | ||
} | ||
|
||
public function delete($id) | ||
{ | ||
} | ||
} |
Oops, something went wrong.