Esempio n. 1
0
 public function actionPreview($id)
 {
     $this->exist($id);
     $message = new \App\Mail($this);
     $message->setHtmlBody($this->row['text']);
     echo $message->getText();
     $this->terminate();
 }
Esempio n. 2
0
 protected function pushNovel($novel)
 {
     $nextChapter = Chapter::getNextChapter($novel);
     if ($nextChapter == null) {
         return;
     }
     $name = $novel->name . ' - ' . $nextChapter->name . '.txt';
     $mail = new \App\Mail();
     $mail->state = 'ready';
     $mail->name = $name;
     $mail->content = $nextChapter->content;
     $mail->novel_id = $novel->id;
     $mail->chapter_id = $nextChapter->id;
     $mail->save();
     $nextChapter->state = 'pushed';
     $nextChapter->save();
     $novel->latestChapter++;
     $novel->save();
 }
Esempio n. 3
0
*/
Route::get('/', 'WelcomeController@index');
Route::get('home', 'HomeController@index');
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
/*_____Routes for the skoolspace registration module__________*/
/*  Bindings for the school, users, clients  */
Route::bind('id', function ($id) {
    return App\User::find($id);
});
Route::bind('username', function ($name) {
    /** @var int $id */
    return App\Group::where('username', $name)->first();
});
Route::bind('mail', function ($id) {
    /** @var int $id */
    return App\Mail::where('id', $id)->first();
});
Route::bind('client', function ($id) {
    /** @var int $id */
    return App\Client::where('id', $id)->first();
});
Route::bind('subject', function ($name) {
    /** @var string $id */
    return new App\Http\Forum\Subject($name);
});
Route::bind('recipient', function ($id) {
    /** @var int $id */
    return App\Client::where('id', $id)->first();
});
Route::bind('event', function ($id) {
    /** @var int $id */