コード例 #1
0
 public function getIndex()
 {
     $title = "Блоки";
     $desc = "обзор и управление Блоками";
     $blocks = \Block::all();
     return view('blocks::list')->withTitle($title)->withDesc($desc)->withBlocks($blocks);
 }
コード例 #2
0
 /**
  * Boot the service provider.
  * @return void
  */
 public function boot()
 {
     $this->loadViewsFrom(__DIR__ . '/../resources/views', 'blocks');
     $this->loadViewsFrom(blocks_path(), 'block');
     $this->mergeConfigFrom(realpath(__DIR__ . '/../config/config.php'), 'module');
     $this->publishes([__DIR__ . '/../public' => public_path('code_mirror')], 'public');
     pusher('sidebar', 'blocks::sidebar', [], 2);
     pusher('widgets', 'blocks::block_widget', ['blocks' => \Block::all()]);
     require __DIR__ . '/routes.php';
     require __DIR__ . '/blade.php';
 }
コード例 #3
0
ファイル: routes.php プロジェクト: fencer-md/stoticlle
    $totalRewarded = $user->userMoney->ammount_won;
    $totalWithdrawn = $user->userMoney->ammount_withdrawn;
    $userMoneyAvailable = $totalAdded + $totalRewarded - ($totalInvested + $totalWithdrawn);
    $view->with('moneyAvailable', $userMoneyAvailable);
});
View::creator('includes.backend.cycles', function ($view) {
    $uid = Auth::user()->id;
    $lastInvest = Transaction::where('user_id', '=', $uid)->where('transaction_direction', '=', 'invested')->orderBy('id', 'DESC')->first();
    $amount = 0;
    if ($lastInvest) {
        $amount = $lastInvest->ammount;
    }
    $view->with('lastInvestedAmmount', $amount);
});
View::creator('homepage', function ($view) {
    $blocks = Block::all();
    // TODO: Improve this part. Add validation.
    foreach ($blocks as $block) {
        $block->content = json_decode($block->content);
    }
    $view->with('blocks', $blocks);
});
App::missing(function ($exception) {
    return Response::view('errors/404', array(), 404);
});
Route::get('rules', function () {
    return View::make('rules');
});
Route::get('news', function () {
    return View::make('news');
});
コード例 #4
0
 public function showBlocks()
 {
     $blocks = Block::all();
     return View::make('backend.admin.config.blockslist')->with('blocks', $blocks);
 }