/** * Bootstrap the application services. * * @return void */ public function boot() { view()->composer(['front.header', 'admin.header'], function ($view) { $languages = []; $folders = File::directories(base_path('resources/lang/')); foreach ($folders as $folder) { $languages[] = str_replace('\\', '', last(explode('/', $folder))); } $view->with('languages', $languages); }); view()->composer('front.header', function ($view) { $apps = Application::all(); $view->with('apps', $apps); }); view()->composer('admin.news.form', function ($view) { $categories = ['update' => trans('news.category.update'), 'maintenance' => trans('news.category.maintenance'), 'event' => trans('news.category.event'), 'contest' => trans('news.category.contest'), 'other' => trans('news.category.other')]; $view->with('categories', $categories); }); view()->composer('front.widgets', function ($view) { $client_status = @fsockopen(settings('server_ip', '127.0.0.1'), 6543, $errCode, $errStr, 1) ? TRUE : FALSE; $worlds = DB::connection('account')->table('worlds')->get(); $view->with('client_status', $client_status)->with('worlds', $worlds); }); view()->composer('admin.donate.settings', function ($view) { $view->with('currencies', trans('donate.currency')); }); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $application = Application::find($id); $author = Author::find($id); $applications = Application::all(); $authors = Author::all(); $versions = [1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0]; return view('application.edit', compact('application', 'author', 'applications', 'authors', 'versions')); }
/** * Save the application settings * * @param Request $request * @return \Illuminate\Http\RedirectResponse */ public function postApps(Request $request) { $apps = Application::all(); foreach ($apps as $app) { $app->enabled = $request->{$app->key . '_enabled'}; $app->save(); } flash()->success(trans('system.apps_edit_success')); return redirect()->back(); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function recentApplication($period, $value) { $filteredArray = array(); $application_details = Application::all()->load('applicants', 'loan'); if ($period == "daily") { foreach ($application_details as $index => $values) { $days = $this::getDays($values->created_at); if ($value >= $days) { array_push($filteredArray, $values); } } } return $filteredArray; }
/** * Store a newly created Application in database. * */ public function store(ApplicationRequest $request) { $input = $request->all(); $application = new Application($input); // If the new Application is to be the default one if ($application->default == 1) { // Set all others existing as not being default in database $applications = Application::all(); foreach ($applications as $app) { $app->default = 0; $app->update(); } } $application->save(); return redirect('application/create'); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if (!$request->is('admin*') && !$request->is('auth/*') && !$request->is('account/*') && !$request->is('character/*')) { // If application is disabled, redirect to next enabled application $application = Application::findOrFail($request->segment(1) !== NULL ? $request->segment(1) : 'news'); if (!$application->enabled) { $applications = Application::all(); foreach ($applications as $application) { if ($application->enabled) { return redirect($application->key); } } } } return $next($request); }
/** * Bootstrap the application services. * * @return void */ public function boot() { view()->composer(['front.header', 'admin.header'], function ($view) { $languages = []; $folders = File::directories(base_path('resources/lang/')); foreach ($folders as $folder) { $languages[] = str_replace('\\', '', last(explode('/', $folder))); } $view->with('languages', $languages); }); view()->composer('front.header', function ($view) { $apps = Application::all(); $view->with('apps', $apps); }); view()->composer('admin.news.form', function ($view) { $categories = ['update' => trans('news.category.update'), 'maintenance' => trans('news.category.maintenance'), 'event' => trans('news.category.event'), 'contest' => trans('news.category.contest'), 'other' => trans('news.category.other')]; $view->with('categories', $categories); }); view()->composer(['admin.shop.form', 'admin.management.mailer'], function ($view) { $masks = [0 => trans('shop.masks.0'), 1 => trans('shop.masks.1'), trans('shop.equipment') => [2 => trans('shop.masks.armor.2'), 16 => trans('shop.masks.armor.16'), 64 => trans('shop.masks.armor.64'), 128 => trans('shop.masks.armor.128'), 256 => trans('shop.masks.armor.256'), 8 => trans('shop.masks.armor.8')], trans('shop.fashion') => [8192 => trans('shop.masks.fashion.8192'), 16384 => trans('shop.masks.fashion.16384'), 32768 => trans('shop.masks.fashion.32768'), 65536 => trans('shop.masks.fashion.65536')], trans('shop.accessories') => [1536 => trans('shop.masks.accessories.1536'), 4 => trans('shop.masks.accessories.4'), 32 => trans('shop.masks.accessories.32')], trans('shop.charms') => [1048576 => trans('shop.masks.charms.1048576'), 2097152 => trans('shop.masks.charms.2097152')], 262144 => trans('shop.masks.262144'), 524288 => trans('shop.masks.524288'), 4096 => trans('shop.masks.4096')]; $view->with('masks', $masks); }); view()->composer('admin.donate.settings', function ($view) { $view->with('currencies', trans('donate.currency')); }); view()->composer('front.widgets', function ($view) { $gms = []; foreach (DB::table('auth')->select('userid')->distinct()->get() as $gm) { $gms[] = User::find($gm->userid); } $view->with('gms', $gms); }); if (Schema::hasTable('pweb_settings')) { view()->share('api', new API()); } view()->share('agent', new Agent()); }
/** * Display a listing of the resource. * * @return Response */ public function index() { return response()->json(Application::all(), 200); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $applications = Application::all(); $authors = Author::all(); return view('application.create', compact('applications', 'authors')); }
<?php Route::get('/', 'staticPagesController@index'); Route::get('/about-us', 'staticPagesController@aboutUs'); Route::get('/contact-us', 'staticPagesController@contactUs'); Route::get('/applications', function () { $applications = \App\Application::all(); $output = ""; foreach ($applications as $application) { $output .= "<h1>" . $application->name . "</h1><br>" . "<i>" . $application->email . "</i><hr>"; } return $output; }); Route::get('/applications-json', function () { $applications = \App\Application::all(); return $applications; }); /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | This route group applies the "web" middleware group to every route | it contains. The "web" middleware group is defined in your HTTP | kernel and includes session state, CSRF protection, and more. | */ Route::group(['middleware' => ['web']], function () { // });