| @ -1,31 +0,0 @@ | |||||
| APP_NAME=Heimdall |  | ||||
| APP_ENV=local |  | ||||
| APP_KEY=base64:I206O8ibx+GQyRE7BeOxDobn04Mfmyyc5Ptzns/C0mY= |  | ||||
| APP_DEBUG=true |  | ||||
| APP_LOG_LEVEL=debug |  | ||||
| APP_URL=http://localhost |  | ||||
| 
 |  | ||||
| DB_CONNECTION=sqlite |  | ||||
| DB_DATABASE=app.sqlite |  | ||||
| 
 |  | ||||
| BROADCAST_DRIVER=log |  | ||||
| CACHE_DRIVER=file |  | ||||
| SESSION_DRIVER=file |  | ||||
| SESSION_LIFETIME=120 |  | ||||
| QUEUE_DRIVER=sync |  | ||||
| 
 |  | ||||
| REDIS_HOST=127.0.0.1 |  | ||||
| REDIS_PASSWORD=null |  | ||||
| REDIS_PORT=6379 |  | ||||
| 
 |  | ||||
| MAIL_DRIVER=smtp |  | ||||
| MAIL_HOST=smtp.mailtrap.io |  | ||||
| MAIL_PORT=2525 |  | ||||
| MAIL_USERNAME=null |  | ||||
| MAIL_PASSWORD=null |  | ||||
| MAIL_ENCRYPTION=null |  | ||||
| 
 |  | ||||
| PUSHER_APP_ID= |  | ||||
| PUSHER_APP_KEY= |  | ||||
| PUSHER_APP_SECRET= |  | ||||
| PUSHER_APP_CLUSTER=mt1 |  | ||||
| @ -1,35 +0,0 @@ | |||||
| APP_NAME=Laravel |  | ||||
| APP_ENV=local |  | ||||
| APP_KEY= |  | ||||
| APP_DEBUG=true |  | ||||
| APP_LOG_LEVEL=debug |  | ||||
| APP_URL=http://localhost |  | ||||
| 
 |  | ||||
| DB_CONNECTION=mysql |  | ||||
| DB_HOST=127.0.0.1 |  | ||||
| DB_PORT=3306 |  | ||||
| DB_DATABASE=homestead |  | ||||
| DB_USERNAME=homestead |  | ||||
| DB_PASSWORD=secret |  | ||||
| 
 |  | ||||
| BROADCAST_DRIVER=log |  | ||||
| CACHE_DRIVER=file |  | ||||
| SESSION_DRIVER=file |  | ||||
| SESSION_LIFETIME=120 |  | ||||
| QUEUE_DRIVER=sync |  | ||||
| 
 |  | ||||
| REDIS_HOST=127.0.0.1 |  | ||||
| REDIS_PASSWORD=null |  | ||||
| REDIS_PORT=6379 |  | ||||
| 
 |  | ||||
| MAIL_DRIVER=smtp |  | ||||
| MAIL_HOST=smtp.mailtrap.io |  | ||||
| MAIL_PORT=2525 |  | ||||
| MAIL_USERNAME=null |  | ||||
| MAIL_PASSWORD=null |  | ||||
| MAIL_ENCRYPTION=null |  | ||||
| 
 |  | ||||
| PUSHER_APP_ID= |  | ||||
| PUSHER_APP_KEY= |  | ||||
| PUSHER_APP_SECRET= |  | ||||
| PUSHER_APP_CLUSTER=mt1 |  | ||||
| @ -1,5 +0,0 @@ | |||||
| * text=auto |  | ||||
| *.css linguist-vendored |  | ||||
| *.scss linguist-vendored |  | ||||
| *.js linguist-vendored |  | ||||
| CHANGELOG.md export-ignore |  | ||||
| @ -1,12 +0,0 @@ | |||||
| /node_modules |  | ||||
| /public/hot |  | ||||
| /public/storage |  | ||||
| /storage/*.key |  | ||||
| /.idea |  | ||||
| /.vagrant |  | ||||
| Homestead.json |  | ||||
| Homestead.yaml |  | ||||
| npm-debug.log |  | ||||
| yarn-error.log |  | ||||
| 
 |  | ||||
| storage/app/public/.DS_Store |  | ||||
| @ -1,59 +0,0 @@ | |||||
| # Release Notes |  | ||||
| 
 |  | ||||
| ## v1.3.0 (2018-02-09) |  | ||||
| 
 |  | ||||
| ### Added |  | ||||
| - guzzlehttp/guzzle as a dependency |  | ||||
| - Variable polling, so interval is increased when an app is idle and decreased when it's active |  | ||||
| - Turkish language translation |  | ||||
| - Added Sabnzbd enhanced application |  | ||||
| 
 |  | ||||
| ### Changed |  | ||||
| - Updated composer dependencies |  | ||||
| - Added live stats to Nzbget supported application   |  | ||||
| - Changed Pihole to an enhanced application |  | ||||
| - Changed NZBGet to an enhanced application |  | ||||
| 
 |  | ||||
| ### Fixed |  | ||||
| - Fixed autocomplete being hard to see |  | ||||
| - Fixed checkboxes not working on edge |  | ||||
| 
 |  | ||||
| 
 |  | ||||
| ## v1.2.0 (2018-02-07) |  | ||||
| 
 |  | ||||
| ### Added |  | ||||
| - Translation support |  | ||||
| - Initial "Supported" application support |  | ||||
| - Finnish translation |  | ||||
| - Swedish translation |  | ||||
| - German translation |  | ||||
| - French translation |  | ||||
| - Spanish translation |  | ||||
| - Duplicati supported application |  | ||||
| - Emby supported application |  | ||||
| - Nzbget supported application |  | ||||
| - Pfsense supported application |  | ||||
| - Pihole supported application |  | ||||
| - Plex supported application |  | ||||
| - Portainer supported application |  | ||||
| - Unifi supported application |  | ||||
| 
 |  | ||||
| ### Changed |  | ||||
| - button layout and behaviour |  | ||||
| 
 |  | ||||
| ### Fixed |  | ||||
| - Bottom of button too short in some browsers |  | ||||
| - Icon not loading back in when required fields not filled in |  | ||||
| 
 |  | ||||
| 
 |  | ||||
| ## v1.1.0 (2018-02-05) |  | ||||
| 
 |  | ||||
| ### Added |  | ||||
| - Ability to change background |  | ||||
| - Settings section |  | ||||
| - Update procedure |  | ||||
| - Google/DuckDuckGo/Bing search from homepage |  | ||||
| - Added edit button to tile page |  | ||||
| 
 |  | ||||
| ### Changed |  | ||||
| - Icon used to put tiles into config mode |  | ||||
| @ -1,21 +0,0 @@ | |||||
| MIT License |  | ||||
| 
 |  | ||||
| Copyright (c) 2018 Chris Hunt |  | ||||
| 
 |  | ||||
| Permission is hereby granted, free of charge, to any person obtaining a copy |  | ||||
| of this software and associated documentation files (the "Software"), to deal |  | ||||
| in the Software without restriction, including without limitation the rights |  | ||||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |  | ||||
| copies of the Software, and to permit persons to whom the Software is |  | ||||
| furnished to do so, subject to the following conditions: |  | ||||
| 
 |  | ||||
| The above copyright notice and this permission notice shall be included in all |  | ||||
| copies or substantial portions of the Software. |  | ||||
| 
 |  | ||||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |  | ||||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |  | ||||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |  | ||||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |  | ||||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |  | ||||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |  | ||||
| SOFTWARE. |  | ||||
| @ -1 +0,0 @@ | |||||
| theme: jekyll-theme-tactile |  | ||||
| @ -1,42 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Console; |  | ||||
| 
 |  | ||||
| use Illuminate\Console\Scheduling\Schedule; |  | ||||
| use Illuminate\Foundation\Console\Kernel as ConsoleKernel; |  | ||||
| 
 |  | ||||
| class Kernel extends ConsoleKernel |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * The Artisan commands provided by your application. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $commands = [ |  | ||||
|         // |  | ||||
|     ]; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Define the application's command schedule. |  | ||||
|      * |  | ||||
|      * @param  \Illuminate\Console\Scheduling\Schedule  $schedule |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     protected function schedule(Schedule $schedule) |  | ||||
|     { |  | ||||
|         // $schedule->command('inspire') |  | ||||
|         //          ->hourly(); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Register the commands for the application. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     protected function commands() |  | ||||
|     { |  | ||||
|         $this->load(__DIR__.'/Commands'); |  | ||||
| 
 |  | ||||
|         require base_path('routes/console.php'); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,53 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Exceptions; |  | ||||
| 
 |  | ||||
| use Exception; |  | ||||
| use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; |  | ||||
| 
 |  | ||||
| class Handler extends ExceptionHandler |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * A list of the exception types that are not reported. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $dontReport = [ |  | ||||
|         // |  | ||||
|     ]; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * A list of the inputs that are never flashed for validation exceptions. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $dontFlash = [ |  | ||||
|         'password', |  | ||||
|         'password_confirmation', |  | ||||
|     ]; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Report or log an exception. |  | ||||
|      * |  | ||||
|      * This is a great spot to send exceptions to Sentry, Bugsnag, etc. |  | ||||
|      * |  | ||||
|      * @param  \Exception  $exception |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function report(Exception $exception) |  | ||||
|     { |  | ||||
|         parent::report($exception); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Render an exception into an HTTP response. |  | ||||
|      * |  | ||||
|      * @param  \Illuminate\Http\Request  $request |  | ||||
|      * @param  \Exception  $exception |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function render($request, Exception $exception) |  | ||||
|     { |  | ||||
|         return parent::render($request, $exception); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,12 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| function format_bytes($bytes, $is_drive_size = true, $beforeunit = '', $afterunit = '') |  | ||||
| { |  | ||||
| 	$btype = ($is_drive_size === true) ? 1000 : 1024; |  | ||||
|     $labels = array('B','KB','MB','GB','TB'); |  | ||||
|     for($x = 0; $bytes >= $btype && $x < (count($labels) - 1); $bytes /= $btype, $x++); // use 1000 rather than 1024 to simulate HD size not real size |  | ||||
|     if($labels[$x] == "TB") return(round($bytes, 3).$beforeunit.$labels[$x].$afterunit); |  | ||||
|     elseif($labels[$x] == "GB") return(round($bytes, 2).$beforeunit.$labels[$x].$afterunit); |  | ||||
|     elseif($labels[$x] == "MB") return(round($bytes, 2).$beforeunit.$labels[$x].$afterunit); |  | ||||
|     else return(round($bytes, 0).$beforeunit.$labels[$x].$afterunit); |  | ||||
| } |  | ||||
| @ -1,32 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Controllers\Auth; |  | ||||
| 
 |  | ||||
| use App\Http\Controllers\Controller; |  | ||||
| use Illuminate\Foundation\Auth\SendsPasswordResetEmails; |  | ||||
| 
 |  | ||||
| class ForgotPasswordController extends Controller |  | ||||
| { |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Password Reset Controller |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This controller is responsible for handling password reset emails and |  | ||||
|     | includes a trait which assists in sending these notifications from |  | ||||
|     | your application to your users. Feel free to explore this trait. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     use SendsPasswordResetEmails; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Create a new controller instance. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function __construct() |  | ||||
|     { |  | ||||
|         $this->middleware('guest'); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,39 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Controllers\Auth; |  | ||||
| 
 |  | ||||
| use App\Http\Controllers\Controller; |  | ||||
| use Illuminate\Foundation\Auth\AuthenticatesUsers; |  | ||||
| 
 |  | ||||
| class LoginController extends Controller |  | ||||
| { |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Login Controller |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This controller handles authenticating users for the application and |  | ||||
|     | redirecting them to your home screen. The controller uses a trait |  | ||||
|     | to conveniently provide its functionality to your applications. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     use AuthenticatesUsers; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Where to redirect users after login. |  | ||||
|      * |  | ||||
|      * @var string |  | ||||
|      */ |  | ||||
|     protected $redirectTo = '/home'; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Create a new controller instance. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function __construct() |  | ||||
|     { |  | ||||
|         $this->middleware('guest')->except('logout'); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,71 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Controllers\Auth; |  | ||||
| 
 |  | ||||
| use App\User; |  | ||||
| use App\Http\Controllers\Controller; |  | ||||
| use Illuminate\Support\Facades\Validator; |  | ||||
| use Illuminate\Foundation\Auth\RegistersUsers; |  | ||||
| 
 |  | ||||
| class RegisterController extends Controller |  | ||||
| { |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Register Controller |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This controller handles the registration of new users as well as their |  | ||||
|     | validation and creation. By default this controller uses a trait to |  | ||||
|     | provide this functionality without requiring any additional code. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     use RegistersUsers; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Where to redirect users after registration. |  | ||||
|      * |  | ||||
|      * @var string |  | ||||
|      */ |  | ||||
|     protected $redirectTo = '/home'; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Create a new controller instance. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function __construct() |  | ||||
|     { |  | ||||
|         $this->middleware('guest'); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Get a validator for an incoming registration request. |  | ||||
|      * |  | ||||
|      * @param  array  $data |  | ||||
|      * @return \Illuminate\Contracts\Validation\Validator |  | ||||
|      */ |  | ||||
|     protected function validator(array $data) |  | ||||
|     { |  | ||||
|         return Validator::make($data, [ |  | ||||
|             'name' => 'required|string|max:255', |  | ||||
|             'email' => 'required|string|email|max:255|unique:users', |  | ||||
|             'password' => 'required|string|min:6|confirmed', |  | ||||
|         ]); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Create a new user instance after a valid registration. |  | ||||
|      * |  | ||||
|      * @param  array  $data |  | ||||
|      * @return \App\User |  | ||||
|      */ |  | ||||
|     protected function create(array $data) |  | ||||
|     { |  | ||||
|         return User::create([ |  | ||||
|             'name' => $data['name'], |  | ||||
|             'email' => $data['email'], |  | ||||
|             'password' => bcrypt($data['password']), |  | ||||
|         ]); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,39 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Controllers\Auth; |  | ||||
| 
 |  | ||||
| use App\Http\Controllers\Controller; |  | ||||
| use Illuminate\Foundation\Auth\ResetsPasswords; |  | ||||
| 
 |  | ||||
| class ResetPasswordController extends Controller |  | ||||
| { |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Password Reset Controller |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This controller is responsible for handling password reset requests |  | ||||
|     | and uses a simple trait to include this behavior. You're free to |  | ||||
|     | explore this trait and override any methods you wish to tweak. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     use ResetsPasswords; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Where to redirect users after resetting their password. |  | ||||
|      * |  | ||||
|      * @var string |  | ||||
|      */ |  | ||||
|     protected $redirectTo = '/home'; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Create a new controller instance. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function __construct() |  | ||||
|     { |  | ||||
|         $this->middleware('guest'); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,13 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Controllers; |  | ||||
| 
 |  | ||||
| use Illuminate\Foundation\Bus\DispatchesJobs; |  | ||||
| use Illuminate\Routing\Controller as BaseController; |  | ||||
| use Illuminate\Foundation\Validation\ValidatesRequests; |  | ||||
| use Illuminate\Foundation\Auth\Access\AuthorizesRequests; |  | ||||
| 
 |  | ||||
| class Controller extends BaseController |  | ||||
| { |  | ||||
|     use AuthorizesRequests, DispatchesJobs, ValidatesRequests; |  | ||||
| } |  | ||||
| @ -1,318 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Controllers; |  | ||||
| 
 |  | ||||
| use Illuminate\Http\Request; |  | ||||
| use App\Item; |  | ||||
| use App\Setting; |  | ||||
| use App\SupportedApps\Nzbget; |  | ||||
| use Illuminate\Support\Facades\Storage; |  | ||||
| 
 |  | ||||
| class ItemController extends Controller |  | ||||
| { |  | ||||
| 
 |  | ||||
|      /** |  | ||||
|      * Display a listing of the resource on the dashboard. |  | ||||
|      * |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function dash() |  | ||||
|     { |  | ||||
|         $data['apps'] = Item::pinned()->orderBy('order', 'asc')->get(); |  | ||||
|         $data['all_apps'] = Item::all(); |  | ||||
|         return view('welcome', $data); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|      /** |  | ||||
|      * Set order on the dashboard. |  | ||||
|      * |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function setOrder(Request $request) |  | ||||
|     { |  | ||||
|         $order = array_filter($request->input('order')); |  | ||||
|         foreach($order as $o => $id) { |  | ||||
|             $item = Item::find($id); |  | ||||
|             $item->order = $o; |  | ||||
|             $item->save(); |  | ||||
|         } |  | ||||
|     } |  | ||||
|      |  | ||||
| 
 |  | ||||
|      /** |  | ||||
|      * Pin item on the dashboard. |  | ||||
|      * |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function pin($id) |  | ||||
|     { |  | ||||
|         $item = Item::findOrFail($id); |  | ||||
|         $item->pinned = true; |  | ||||
|         $item->save(); |  | ||||
|         return redirect()->route('dash'); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|      /** |  | ||||
|      * Unpin item on the dashboard. |  | ||||
|      * |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function unpin($id) |  | ||||
|     { |  | ||||
|         $item = Item::findOrFail($id); |  | ||||
|         $item->pinned = false; |  | ||||
|         $item->save(); |  | ||||
|         return redirect()->route('dash'); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|      /** |  | ||||
|      * Unpin item on the dashboard. |  | ||||
|      * |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function pinToggle($id, $ajax=false) |  | ||||
|     { |  | ||||
|         $item = Item::findOrFail($id); |  | ||||
|         $new = ((bool)$item->pinned === true) ? false : true; |  | ||||
|         $item->pinned = $new; |  | ||||
|         $item->save(); |  | ||||
|         if($ajax) { |  | ||||
|             $data['apps'] = Item::pinned()->get(); |  | ||||
|             $data['ajax'] = true; |  | ||||
|             return view('sortable', $data); |  | ||||
|         } else { |  | ||||
|             return redirect()->route('dash');            |  | ||||
|         } |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     |  | ||||
|     /** |  | ||||
|      * Display a listing of the resource. |  | ||||
|      * |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function index(Request $request) |  | ||||
|     { |  | ||||
|         $trash = (bool)$request->input('trash'); |  | ||||
| 
 |  | ||||
|         $data['apps'] = Item::orderBy('title', 'asc')->get(); |  | ||||
|         $data['trash'] = Item::onlyTrashed()->get(); |  | ||||
|         if($trash) { |  | ||||
|             return view('items.trash', $data); |  | ||||
|         } else { |  | ||||
|             return view('items.list', $data); |  | ||||
|         } |  | ||||
|     } |  | ||||
| 
 |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Show the form for creating a new resource. |  | ||||
|      * |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function create() |  | ||||
|     { |  | ||||
|         // |  | ||||
|         $data = []; |  | ||||
|         return view('items.create', $data); |  | ||||
| 
 |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Store a newly created resource in storage. |  | ||||
|      * |  | ||||
|      * @param  \Illuminate\Http\Request  $request |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function store(Request $request) |  | ||||
|     { |  | ||||
|         // |  | ||||
|         $validatedData = $request->validate([ |  | ||||
|             'title' => 'required|max:255', |  | ||||
|             'url' => 'required', |  | ||||
|         ]); |  | ||||
| 
 |  | ||||
|         if($request->hasFile('file')) { |  | ||||
|             $path = $request->file('file')->store('icons'); |  | ||||
|             $request->merge([ |  | ||||
|                 'icon' => $path |  | ||||
|             ]); |  | ||||
|         } |  | ||||
| 
 |  | ||||
|         $config = Item::checkConfig($request->input('config')); |  | ||||
|         $request->merge([ |  | ||||
|             'description' => $config |  | ||||
|         ]); |  | ||||
| 
 |  | ||||
|         //die(print_r($request->input('config'))); |  | ||||
|          |  | ||||
|         Item::create($request->all()); |  | ||||
| 
 |  | ||||
|         return redirect()->route('dash') |  | ||||
|             ->with('success', __('app.alert.success.item_created')); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Display the specified resource. |  | ||||
|      * |  | ||||
|      * @param  int  $id |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function show($id) |  | ||||
|     { |  | ||||
|         // |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Show the form for editing the specified resource. |  | ||||
|      * |  | ||||
|      * @param  int  $id |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function edit($id) |  | ||||
|     { |  | ||||
|         // Get the item |  | ||||
|         $item = Item::find($id); |  | ||||
| 
 |  | ||||
|         // show the edit form and pass the nerd |  | ||||
|         return view('items.edit') |  | ||||
|             ->with('item', $item);     |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Update the specified resource in storage. |  | ||||
|      * |  | ||||
|      * @param  \Illuminate\Http\Request  $request |  | ||||
|      * @param  int  $id |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function update(Request $request, $id) |  | ||||
|     { |  | ||||
|         $validatedData = $request->validate([ |  | ||||
|             'title' => 'required|max:255', |  | ||||
|             'url' => 'required', |  | ||||
|         ]); |  | ||||
|             //die(print_r($request->all())); |  | ||||
|         if($request->hasFile('file')) { |  | ||||
|             $path = $request->file('file')->store('icons'); |  | ||||
|             $request->merge([ |  | ||||
|                 'icon' => $path |  | ||||
|             ]); |  | ||||
|         } |  | ||||
|          |  | ||||
|         $config = Item::checkConfig($request->input('config')); |  | ||||
|         $request->merge([ |  | ||||
|             'description' => $config |  | ||||
|         ]); |  | ||||
| 
 |  | ||||
|         Item::find($id)->update($request->all()); |  | ||||
| 
 |  | ||||
|         return redirect()->route('dash') |  | ||||
|             ->with('success',__('app.alert.success.item_updated')); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Remove the specified resource from storage. |  | ||||
|      * |  | ||||
|      * @param  int  $id |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function destroy(Request $request, $id) |  | ||||
|     { |  | ||||
|         // |  | ||||
|         $force = (bool)$request->input('force'); |  | ||||
|         if($force) { |  | ||||
|             Item::withTrashed() |  | ||||
|                 ->where('id', $id) |  | ||||
|                 ->forceDelete(); |  | ||||
|         } else { |  | ||||
|             Item::find($id)->delete(); |  | ||||
|         } |  | ||||
|          |  | ||||
|         return redirect()->route('items.index') |  | ||||
|             ->with('success',__('app.alert.success.item_deleted')); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Restore the specified resource from soft deletion. |  | ||||
|      * |  | ||||
|      * @param  int  $id |  | ||||
|      * @return \Illuminate\Http\Response |  | ||||
|      */ |  | ||||
|     public function restore($id) |  | ||||
|     { |  | ||||
|         // |  | ||||
|         Item::withTrashed() |  | ||||
|                 ->where('id', $id) |  | ||||
|                 ->restore();         |  | ||||
|         return redirect()->route('items.index') |  | ||||
|             ->with('success',__('app.alert.success.item_restored')); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     public function isSupportedAppByKey($app) |  | ||||
|     { |  | ||||
|         $output = false; |  | ||||
|         $all_supported = Item::supportedList(); |  | ||||
|         if(array_key_exists($app, $all_supported)) { |  | ||||
|             $output = new $all_supported[$app]; |  | ||||
|         } |  | ||||
|         return $output; |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Return details for supported apps |  | ||||
|      * |  | ||||
|      * @return Json |  | ||||
|      */ |  | ||||
|     public function appload(Request $request) |  | ||||
|     { |  | ||||
|         $output = []; |  | ||||
|         $app = $request->input('app'); |  | ||||
| 
 |  | ||||
|         if(($app_details = $this->isSupportedAppByKey($app)) !== false) { |  | ||||
|             // basic details |  | ||||
|             $output['icon'] = $app_details->icon(); |  | ||||
|             $output['colour'] = $app_details->defaultColour(); |  | ||||
| 
 |  | ||||
|             // live details |  | ||||
|             if($app_details instanceof \App\SupportedApps\Contracts\Livestats) { |  | ||||
|                 $output['config'] = $app_details->configDetails(); |  | ||||
|             } else { |  | ||||
|                 $output['config'] = null; |  | ||||
|             } |  | ||||
|         } |  | ||||
|          |  | ||||
|         return json_encode($output); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     public function testConfig(Request $request) |  | ||||
|     { |  | ||||
|         $data = $request->input('data'); |  | ||||
|         //$url = $data[array_search('url', array_column($data, 'name'))]['value']; |  | ||||
|          |  | ||||
|         $app = $data['type']; |  | ||||
| 
 |  | ||||
|         $app_details = new $app(); |  | ||||
|         $app_details->config = (object)$data; |  | ||||
|         $app_details->testConfig(); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     public function getStats($id) |  | ||||
|     { |  | ||||
|         $item = Item::find($id); |  | ||||
| 
 |  | ||||
|         $config = json_decode($item->description); |  | ||||
|         if(isset($config->type)) { |  | ||||
|             $config->url = $item->url; |  | ||||
|             if(isset($config->override_url) && !empty($config->override_url)) { |  | ||||
|                 $config->url = $config->override_url; |  | ||||
|             } |  | ||||
|             $app_details = new $config->type; |  | ||||
|             $app_details->config = $config; |  | ||||
|             echo $app_details->executeConfig(); |  | ||||
|         } |  | ||||
|          |  | ||||
|     } |  | ||||
| 
 |  | ||||
|      |  | ||||
| } |  | ||||
| @ -1,102 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Controllers; |  | ||||
| 
 |  | ||||
| use Illuminate\Http\Request; |  | ||||
| use App\Setting; |  | ||||
| use App\SettingGroup; |  | ||||
| use App\Http\Controllers\Controller; |  | ||||
| 
 |  | ||||
| class SettingsController extends Controller |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * @return \Illuminate\View\View |  | ||||
|      */ |  | ||||
|     public function index() |  | ||||
|     { |  | ||||
|         $settings = SettingGroup::with([ |  | ||||
|             'settings', |  | ||||
|         ])->orderBy('order', 'ASC')->get(); |  | ||||
| 
 |  | ||||
|         return view('settings.list')->with([ |  | ||||
|             'groups' => $settings, |  | ||||
|         ]); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * @param int $id |  | ||||
|      * |  | ||||
|      * @return \Illuminate\Http\RedirectResponse |  | ||||
|      */ |  | ||||
|     public function edit($id) |  | ||||
|     { |  | ||||
|         $setting = Setting::find($id); |  | ||||
| 
 |  | ||||
|         if((bool)$setting->system === true) return abort(404); |  | ||||
| 
 |  | ||||
|         if (!is_null($setting)) { |  | ||||
|             return view('settings.edit')->with([ |  | ||||
|                 'setting' => $setting, |  | ||||
|             ]); |  | ||||
|         } else { |  | ||||
|             return redirect()->route('settings.list')->with([ |  | ||||
|                 'error' => __('app.alert.error.not_exist'), |  | ||||
|             ]); |  | ||||
|         } |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * @param int $id |  | ||||
|      * |  | ||||
|      * @return \Illuminate\Http\RedirectResponse |  | ||||
|      */ |  | ||||
|     public function update(Request $request, $id) |  | ||||
|     { |  | ||||
|         $setting = Setting::find($id); |  | ||||
| 
 |  | ||||
|         if (!is_null($setting)) { |  | ||||
|             $data = Setting::getInput(); |  | ||||
| 
 |  | ||||
|             if ($setting->type == 'image') { |  | ||||
| 
 |  | ||||
| 
 |  | ||||
|                 if($request->hasFile('value')) { |  | ||||
|                     $path = $request->file('value')->store('backgrounds'); |  | ||||
|                     $setting->value = $path; |  | ||||
|                 } |  | ||||
|              |  | ||||
| 
 |  | ||||
| 
 |  | ||||
|             } else { |  | ||||
|                 $setting->value = $data->value; |  | ||||
|             } |  | ||||
| 
 |  | ||||
|             $setting->save(); |  | ||||
| 
 |  | ||||
|             return redirect()->route('settings.index')->with([ |  | ||||
|                 'success' => __('app.alert.success.setting_updated'), |  | ||||
|             ]); |  | ||||
|         } else { |  | ||||
|             return redirect()->route('settings.index')->with([ |  | ||||
|                 'error' => __('app.alert.error.not_exist'), |  | ||||
|             ]); |  | ||||
|         } |  | ||||
|     } |  | ||||
|     /** |  | ||||
|      * @param int $id |  | ||||
|      * |  | ||||
|      * @return \Illuminate\Http\RedirectResponse |  | ||||
|      */ |  | ||||
|     public function clear($id) |  | ||||
|     { |  | ||||
|         $setting = Setting::find($id); |  | ||||
|         if((bool)$setting->system !== true) { |  | ||||
|             $setting->value = ''; |  | ||||
|             $setting->save(); |  | ||||
|         } |  | ||||
|         return redirect()->route('settings.index')->with([ |  | ||||
|             'success' => __('app.alert.success.setting_updated'), |  | ||||
|         ]); |  | ||||
|      |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,61 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http; |  | ||||
| 
 |  | ||||
| use Illuminate\Foundation\Http\Kernel as HttpKernel; |  | ||||
| 
 |  | ||||
| class Kernel extends HttpKernel |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * The application's global HTTP middleware stack. |  | ||||
|      * |  | ||||
|      * These middleware are run during every request to your application. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $middleware = [ |  | ||||
|         \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, |  | ||||
|         \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, |  | ||||
|         \App\Http\Middleware\TrimStrings::class, |  | ||||
|         \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, |  | ||||
|         \App\Http\Middleware\TrustProxies::class, |  | ||||
|     ]; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * The application's route middleware groups. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $middlewareGroups = [ |  | ||||
|         'web' => [ |  | ||||
|             \App\Http\Middleware\EncryptCookies::class, |  | ||||
|             \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, |  | ||||
|             \Illuminate\Session\Middleware\StartSession::class, |  | ||||
|             // \Illuminate\Session\Middleware\AuthenticateSession::class, |  | ||||
|             \Illuminate\View\Middleware\ShareErrorsFromSession::class, |  | ||||
|             \App\Http\Middleware\VerifyCsrfToken::class, |  | ||||
|             \Illuminate\Routing\Middleware\SubstituteBindings::class, |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'api' => [ |  | ||||
|             'throttle:60,1', |  | ||||
|             'bindings', |  | ||||
|         ], |  | ||||
|     ]; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * The application's route middleware. |  | ||||
|      * |  | ||||
|      * These middleware may be assigned to groups or used individually. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $routeMiddleware = [ |  | ||||
|         'auth' => \Illuminate\Auth\Middleware\Authenticate::class, |  | ||||
|         'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, |  | ||||
|         'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, |  | ||||
|         'can' => \Illuminate\Auth\Middleware\Authorize::class, |  | ||||
|         'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, |  | ||||
|         'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, |  | ||||
|     ]; |  | ||||
| } |  | ||||
| @ -1,17 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Middleware; |  | ||||
| 
 |  | ||||
| use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; |  | ||||
| 
 |  | ||||
| class EncryptCookies extends Middleware |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * The names of the cookies that should not be encrypted. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $except = [ |  | ||||
|         // |  | ||||
|     ]; |  | ||||
| } |  | ||||
| @ -1,26 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Middleware; |  | ||||
| 
 |  | ||||
| use Closure; |  | ||||
| use Illuminate\Support\Facades\Auth; |  | ||||
| 
 |  | ||||
| class RedirectIfAuthenticated |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * Handle an incoming request. |  | ||||
|      * |  | ||||
|      * @param  \Illuminate\Http\Request  $request |  | ||||
|      * @param  \Closure  $next |  | ||||
|      * @param  string|null  $guard |  | ||||
|      * @return mixed |  | ||||
|      */ |  | ||||
|     public function handle($request, Closure $next, $guard = null) |  | ||||
|     { |  | ||||
|         if (Auth::guard($guard)->check()) { |  | ||||
|             return redirect('/home'); |  | ||||
|         } |  | ||||
| 
 |  | ||||
|         return $next($request); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,18 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Middleware; |  | ||||
| 
 |  | ||||
| use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; |  | ||||
| 
 |  | ||||
| class TrimStrings extends Middleware |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * The names of the attributes that should not be trimmed. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $except = [ |  | ||||
|         'password', |  | ||||
|         'password_confirmation', |  | ||||
|     ]; |  | ||||
| } |  | ||||
| @ -1,29 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Middleware; |  | ||||
| 
 |  | ||||
| use Illuminate\Http\Request; |  | ||||
| use Fideloper\Proxy\TrustProxies as Middleware; |  | ||||
| 
 |  | ||||
| class TrustProxies extends Middleware |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * The trusted proxies for this application. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $proxies; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * The current proxy header mappings. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $headers = [ |  | ||||
|         Request::HEADER_FORWARDED => 'FORWARDED', |  | ||||
|         Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR', |  | ||||
|         Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST', |  | ||||
|         Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT', |  | ||||
|         Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO', |  | ||||
|     ]; |  | ||||
| } |  | ||||
| @ -1,21 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Http\Middleware; |  | ||||
| 
 |  | ||||
| use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; |  | ||||
| 
 |  | ||||
| class VerifyCsrfToken extends Middleware |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * The URIs that should be excluded from CSRF verification. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $except = [ |  | ||||
|         // |  | ||||
|         'order', |  | ||||
|         'appload', |  | ||||
|         'test_config', |  | ||||
|         //'get_stats' |  | ||||
|     ]; |  | ||||
| } |  | ||||
| @ -1,99 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App; |  | ||||
| 
 |  | ||||
| use Illuminate\Database\Eloquent\Model; |  | ||||
| use Symfony\Component\ClassLoader\ClassMapGenerator; |  | ||||
| use Illuminate\Database\Eloquent\SoftDeletes; |  | ||||
| 
 |  | ||||
| 
 |  | ||||
| class Item extends Model |  | ||||
| { |  | ||||
|     use SoftDeletes; |  | ||||
| 
 |  | ||||
|     // |  | ||||
|     protected $fillable = [ |  | ||||
|         'title', 'url', 'colour', 'icon', 'description', 'pinned', 'order' |  | ||||
|     ]; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * The attributes that should be mutated to dates. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $dates = ['deleted_at']; |  | ||||
| 
 |  | ||||
|     public static function supportedList() |  | ||||
|     { |  | ||||
|         return [ |  | ||||
|             'Duplicati' => \App\SupportedApps\Duplicati::class, |  | ||||
|             'Emby' => \App\SupportedApps\Emby::class, |  | ||||
|             'NZBGet' => \App\SupportedApps\Nzbget::class, |  | ||||
|             'pFsense' => \App\SupportedApps\Pfsense::class, |  | ||||
|             'Pihole' => \App\SupportedApps\Pihole::class, |  | ||||
|             'Plex' => \App\SupportedApps\Plex::class, |  | ||||
|             'Plexpy' => \App\SupportedApps\Plexpy::class, |  | ||||
|             'Portainer' => \App\SupportedApps\Portainer::class, |  | ||||
|             'UniFi' => \App\SupportedApps\Unifi::class, |  | ||||
|             'Nextcloud' => \App\SupportedApps\Nextcloud::class, |  | ||||
|             'Sabnzbd' => \App\SupportedApps\Sabnzbd::class, |  | ||||
|         ]; |  | ||||
|     } |  | ||||
|     public static function supportedOptions() |  | ||||
|     { |  | ||||
|         return array_keys(self::supportedList()); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Scope a query to only include pinned items. |  | ||||
|      * |  | ||||
|      * @param \Illuminate\Database\Eloquent\Builder $query |  | ||||
|      * @return \Illuminate\Database\Eloquent\Builder |  | ||||
|      */ |  | ||||
|     public function scopePinned($query) |  | ||||
|     { |  | ||||
|         return $query->where('pinned', 1); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     public function getConfigAttribute() |  | ||||
|     { |  | ||||
|         $output = null; |  | ||||
|         $view = null; |  | ||||
|         if(isset($this->description) && !empty($this->description)){ |  | ||||
|             $output = json_decode($this->description); |  | ||||
|             $output = is_object($output) ? $output : new \stdClass(); |  | ||||
|             if(isset($output->type) && !empty($output->type)) { |  | ||||
|                 $class = $output->type; |  | ||||
|                 $sap = new $class(); |  | ||||
|                 $view = $sap->configDetails(); |  | ||||
|                 $output->view = $view; |  | ||||
|             } |  | ||||
|             if(!isset($output->dataonly)) $output->dataonly = '0'; |  | ||||
|              |  | ||||
|         } |  | ||||
|         return (object)$output; |  | ||||
|     } |  | ||||
|     public static function checkConfig($config) |  | ||||
|     { |  | ||||
|         if(empty($config)) { |  | ||||
|             $config = null; |  | ||||
|         } else { |  | ||||
|             $store = false; |  | ||||
|             //die(var_dump($config)); |  | ||||
|             foreach($config as $key => $check) { |  | ||||
|                 if($key == 'type') continue; |  | ||||
|                 if($key == 'dataonly') continue; |  | ||||
|                 if(!empty($check) && $check != '0') { |  | ||||
|                     $store = true; |  | ||||
|                     break; |  | ||||
|                 } |  | ||||
|             } |  | ||||
|             //die(var_dump($store)) |  | ||||
|              |  | ||||
|             $config['enabled'] = ($store) ? true : false; |  | ||||
|             $config = json_encode($config); |  | ||||
|         } |  | ||||
|         return $config; |  | ||||
| 
 |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,68 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Providers; |  | ||||
| 
 |  | ||||
| use Illuminate\Support\ServiceProvider; |  | ||||
| use Artisan; |  | ||||
| use Schema; |  | ||||
| use App\Setting; |  | ||||
| 
 |  | ||||
| class AppServiceProvider extends ServiceProvider |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * Bootstrap any application services. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function boot() |  | ||||
|     { |  | ||||
|         $alt_bg = ''; |  | ||||
| 
 |  | ||||
|         if(!is_file(base_path('.env'))) { |  | ||||
|             touch(base_path('.env')); |  | ||||
|             Artisan::call('key:generate'); |  | ||||
|         } |  | ||||
|         if(!is_file(database_path('app.sqlite'))) { |  | ||||
|             // first time setup |  | ||||
|             touch(database_path('app.sqlite')); |  | ||||
|             Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true)); |  | ||||
|             Artisan::call('storage:link'); |  | ||||
|             //Cache |  | ||||
|             //Artisan::call('config:cache'); |  | ||||
|             //Artisan::call('route:cache'); |  | ||||
|         } |  | ||||
|         if(is_file(database_path('app.sqlite'))) { |  | ||||
|             if(Schema::hasTable('settings')) { |  | ||||
|                 if($bg_image = Setting::fetch('background_image')) { |  | ||||
|                     $alt_bg = ' style="background-image: url('.asset('storage/'.$bg_image).')"'; |  | ||||
|                 } |  | ||||
| 
 |  | ||||
|                 // check version to see if an upgrade is needed |  | ||||
|                 $db_version = Setting::fetch('version'); |  | ||||
|                 $app_version = config('app.version'); |  | ||||
|                 if(version_compare($app_version, $db_version) == 1) { // app is higher than db, so need to run migrations etc |  | ||||
|                     Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true));                    |  | ||||
|                 } |  | ||||
|             } else { |  | ||||
|                 Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true));  |  | ||||
|             } |  | ||||
|             $lang = Setting::fetch('language'); |  | ||||
|             \App::setLocale($lang); |  | ||||
| 
 |  | ||||
|         } |  | ||||
|         view()->share('alt_bg', $alt_bg); |  | ||||
| 
 |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Register any application services. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function register() |  | ||||
|     { |  | ||||
|         $this->app->singleton('settings', function () { |  | ||||
|             return new Setting(); |  | ||||
|         }); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,30 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Providers; |  | ||||
| 
 |  | ||||
| use Illuminate\Support\Facades\Gate; |  | ||||
| use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; |  | ||||
| 
 |  | ||||
| class AuthServiceProvider extends ServiceProvider |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * The policy mappings for the application. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $policies = [ |  | ||||
|         'App\Model' => 'App\Policies\ModelPolicy', |  | ||||
|     ]; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Register any authentication / authorization services. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function boot() |  | ||||
|     { |  | ||||
|         $this->registerPolicies(); |  | ||||
| 
 |  | ||||
|         // |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,21 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Providers; |  | ||||
| 
 |  | ||||
| use Illuminate\Support\ServiceProvider; |  | ||||
| use Illuminate\Support\Facades\Broadcast; |  | ||||
| 
 |  | ||||
| class BroadcastServiceProvider extends ServiceProvider |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * Bootstrap any application services. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function boot() |  | ||||
|     { |  | ||||
|         Broadcast::routes(); |  | ||||
| 
 |  | ||||
|         require base_path('routes/channels.php'); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,32 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Providers; |  | ||||
| 
 |  | ||||
| use Illuminate\Support\Facades\Event; |  | ||||
| use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; |  | ||||
| 
 |  | ||||
| class EventServiceProvider extends ServiceProvider |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * The event listener mappings for the application. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $listen = [ |  | ||||
|         'App\Events\Event' => [ |  | ||||
|             'App\Listeners\EventListener', |  | ||||
|         ], |  | ||||
|     ]; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Register any events for your application. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function boot() |  | ||||
|     { |  | ||||
|         parent::boot(); |  | ||||
| 
 |  | ||||
|         // |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,73 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App\Providers; |  | ||||
| 
 |  | ||||
| use Illuminate\Support\Facades\Route; |  | ||||
| use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; |  | ||||
| 
 |  | ||||
| class RouteServiceProvider extends ServiceProvider |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * This namespace is applied to your controller routes. |  | ||||
|      * |  | ||||
|      * In addition, it is set as the URL generator's root namespace. |  | ||||
|      * |  | ||||
|      * @var string |  | ||||
|      */ |  | ||||
|     protected $namespace = 'App\Http\Controllers'; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Define your route model bindings, pattern filters, etc. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function boot() |  | ||||
|     { |  | ||||
|         // |  | ||||
| 
 |  | ||||
|         parent::boot(); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Define the routes for the application. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function map() |  | ||||
|     { |  | ||||
|         $this->mapApiRoutes(); |  | ||||
| 
 |  | ||||
|         $this->mapWebRoutes(); |  | ||||
| 
 |  | ||||
|         // |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Define the "web" routes for the application. |  | ||||
|      * |  | ||||
|      * These routes all receive session state, CSRF protection, etc. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     protected function mapWebRoutes() |  | ||||
|     { |  | ||||
|         Route::middleware('web') |  | ||||
|              ->namespace($this->namespace) |  | ||||
|              ->group(base_path('routes/web.php')); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Define the "api" routes for the application. |  | ||||
|      * |  | ||||
|      * These routes are typically stateless. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     protected function mapApiRoutes() |  | ||||
|     { |  | ||||
|         Route::prefix('api') |  | ||||
|              ->middleware('api') |  | ||||
|              ->namespace($this->namespace) |  | ||||
|              ->group(base_path('routes/api.php')); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,218 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App; |  | ||||
| 
 |  | ||||
| use Illuminate\Database\Eloquent\Model; |  | ||||
| use Illuminate\Support\Facades\Input; |  | ||||
| use Form; |  | ||||
| 
 |  | ||||
| class Setting extends Model |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * The database table used by the model. |  | ||||
|      * |  | ||||
|      * @var string |  | ||||
|      */ |  | ||||
|     protected $table = 'settings'; |  | ||||
| 
 |  | ||||
|     protected $fillable = [ |  | ||||
|         'id', 'group_id', 'key', 'type', 'options', 'label', 'value', 'order', 'system' |  | ||||
|     ]; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Tell the Model this Table doesn't support timestamps. |  | ||||
|      * |  | ||||
|      * @var bool |  | ||||
|      */ |  | ||||
|     public $timestamps = false; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Cache storage for Settings. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected static $cache = []; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * @return array |  | ||||
|      */ |  | ||||
|     public static function getInput() |  | ||||
|     { |  | ||||
|         return (object) [ |  | ||||
|             'value' => Input::get('value'), |  | ||||
|             'image' => Input::file('value'), |  | ||||
|         ]; |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     public function getListValueAttribute() |  | ||||
|     { |  | ||||
|         switch($this->type) { |  | ||||
|             case 'image': |  | ||||
|                 if(!empty($this->value)) { |  | ||||
|                     $value = '<a href="'.asset('storage/'.$this->value).'" title="'.__('app.settings.view').'" target="_blank">'.__('app.settings.view').'</a>'; |  | ||||
|                 } else { |  | ||||
|                     $value = __('app.options.none'); |  | ||||
|                 }     |  | ||||
|                 break; |  | ||||
|             case 'boolean': |  | ||||
|                 if((bool)$this->value === true) { |  | ||||
|                     $value = __('app.options.yes'); |  | ||||
|                 } else { |  | ||||
|                     $value = __('app.options.no'); |  | ||||
|                 }     |  | ||||
|                 break; |  | ||||
|             case 'select': |  | ||||
|                 if(!empty($this->value) && $this->value !== 'none') { |  | ||||
|                     $options =  (array)json_decode($this->options); |  | ||||
|                     $value = __($options[$this->value]); |  | ||||
|                 } else { |  | ||||
|                     $value = __('app.options.none'); |  | ||||
|                 }                 |  | ||||
|                 break; |  | ||||
|             default: |  | ||||
|                 $value = __($this->value); |  | ||||
|                 break; |  | ||||
|         } |  | ||||
| 
 |  | ||||
|         return $value; |  | ||||
| 
 |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     public function getEditValueAttribute() |  | ||||
|     { |  | ||||
|         switch($this->type) { |  | ||||
|             case 'image': |  | ||||
|                 $value = ''; |  | ||||
|                 if(isset($this->value) && !empty($this->value)) { |  | ||||
|                     $value .= '<a class="setting-view-image" href="'.asset('storage/'.$this->value).'" title="'.__('app.settings.view').'" target="_blank"><img src="'.asset('storage/'.$this->value).'" /></a>'; |  | ||||
|                 } |  | ||||
|                 $value .= Form::file('value', ['class' => 'form-control']); |  | ||||
|                 if(isset($this->value) && !empty($this->value)) { |  | ||||
|                     $value .= '<a class="settinglink" href="'.route('settings.clear', $this->id).'" title="'.__('app.settings.remove').'">'.__('app.settings.reset').'</a>'; |  | ||||
|                 } |  | ||||
|                  |  | ||||
|                 break; |  | ||||
|             case 'boolean': |  | ||||
|                 $checked = false; |  | ||||
|                 if(isset($this->value) && (bool)$this->value === true) $checked = true; |  | ||||
|                 $set_checked = ($checked) ? ' checked="checked"' : ''; |  | ||||
|                 $value = ' |  | ||||
|                 <input type="hidden" name="value" value="0" /> |  | ||||
|                 <label class="switch"> |  | ||||
|                     <input type="checkbox" name="value" value="1"'.$set_checked.' /> |  | ||||
|                     <span class="slider round"></span> |  | ||||
|                 </label>'; |  | ||||
| 
 |  | ||||
|                 break; |  | ||||
|             case 'select': |  | ||||
|                 $options = json_decode($this->options); |  | ||||
|                 foreach($options as $key => $opt) { |  | ||||
|                     $options->$key = __($opt); |  | ||||
|                 } |  | ||||
|                 $value = Form::select('value', $options, null, ['class' => 'form-control']); |  | ||||
|                 break; |  | ||||
|             default: |  | ||||
|                 $value = Form::text('value', null, ['class' => 'form-control']); |  | ||||
|                 break; |  | ||||
|         } |  | ||||
| 
 |  | ||||
|         return $value; |  | ||||
| 
 |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     public function group() |  | ||||
|     { |  | ||||
|         return $this->belongsTo('App\SettingGroup', 'group_id'); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * @param string $key |  | ||||
|      * |  | ||||
|      * @return mixed |  | ||||
|      */ |  | ||||
|     public static function fetch($key) |  | ||||
|     { |  | ||||
|         if (Setting::cached($key)) { |  | ||||
|             return Setting::$cache[$key]; |  | ||||
|         } else { |  | ||||
|             $find = self::where('key', '=', $key)->first(); |  | ||||
| 
 |  | ||||
|             if (!is_null($find)) { |  | ||||
|                 $value = $find->value; |  | ||||
|                 Setting::add($key, $value); |  | ||||
| 
 |  | ||||
|                 return $value; |  | ||||
|             } else { |  | ||||
|                 return false; |  | ||||
|             } |  | ||||
|         } |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * @param string $key |  | ||||
|      * @param $value |  | ||||
|      */ |  | ||||
|     public static function add($key, $value) |  | ||||
|     { |  | ||||
|         Setting::$cache[$key] = $value; |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * @param string $key |  | ||||
|      * |  | ||||
|      * @return bool |  | ||||
|      */ |  | ||||
|     public static function cached($key) |  | ||||
|     { |  | ||||
|         return array_key_exists($key, Setting::$cache); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * @return html |  | ||||
|      */ |  | ||||
|     public static function search() |  | ||||
|     { |  | ||||
|         $output = ''; |  | ||||
|         $homepage_search = self::fetch('homepage_search'); |  | ||||
|         $search_provider = self::where('key', '=', 'search_provider')->first(); |  | ||||
|          |  | ||||
|         //die(var_dump($search_provider->value)); |  | ||||
|         // return early if search isn't applicable |  | ||||
|         if((bool)$homepage_search !== true) return $output; |  | ||||
|         if($search_provider->value === 'none') return $output; |  | ||||
|         if(empty($search_provider->value)) return $output; |  | ||||
|         if(is_null($search_provider->value)) return $output; |  | ||||
| 
 |  | ||||
| 
 |  | ||||
|         if((bool)$homepage_search && (bool)$search_provider) { |  | ||||
| 
 |  | ||||
|             $options = (array)json_decode($search_provider->options); |  | ||||
|             $name = $options[$search_provider->value]; |  | ||||
|             if((bool)$search_provider->value) { |  | ||||
|                 switch($search_provider->value) { |  | ||||
|                     case 'google': |  | ||||
|                         $url = 'https://www.google.com/search'; |  | ||||
|                         $var = 'q'; |  | ||||
|                         break; |  | ||||
|                     case 'ddg': |  | ||||
|                         $url = 'https://duckduckgo.com/'; |  | ||||
|                         $var = 'q'; |  | ||||
|                         break; |  | ||||
|                     case 'bing': |  | ||||
|                         $url = 'https://www.bing.com/search'; |  | ||||
|                         $var = 'q'; |  | ||||
|                         break; |  | ||||
|                 } |  | ||||
|                 $output .= '<div class="searchform">'; |  | ||||
|                 $output .= Form::open(['url' => $url, 'method' => 'get']); |  | ||||
|                 $output .= '<div class="input-container">'; |  | ||||
|                 $output .= Form::text($var, null, ['class' => 'homesearch', 'placeholder' => __($name).' '.__('app.settings.search').'...']); |  | ||||
|                 $output .= '<button type="submit">'.ucwords(__('app.settings.search')).'</button>'; |  | ||||
|                 $output .= '</div>'; |  | ||||
|                 $output .= Form::close(); |  | ||||
|                 $output .= '</div>'; |  | ||||
|             } |  | ||||
|         } |  | ||||
|         return $output; |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,27 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App; |  | ||||
| 
 |  | ||||
| use Illuminate\Database\Eloquent\Model; |  | ||||
| 
 |  | ||||
| class SettingGroup extends Model |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * The database table used by the model. |  | ||||
|      * |  | ||||
|      * @var string |  | ||||
|      */ |  | ||||
|     protected $table = 'setting_groups'; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Tell the Model this Table doesn't support timestamps. |  | ||||
|      * |  | ||||
|      * @var bool |  | ||||
|      */ |  | ||||
|     public $timestamps = false; |  | ||||
| 
 |  | ||||
|     public function settings() |  | ||||
|     { |  | ||||
|         return $this->hasMany('App\Setting', 'group_id'); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,9 +0,0 @@ | |||||
| <?php namespace App\SupportedApps\Contracts; |  | ||||
| 
 |  | ||||
| interface Applications { |  | ||||
| 
 |  | ||||
|     public function defaultColour(); |  | ||||
| 
 |  | ||||
|     public function icon(); |  | ||||
|      |  | ||||
| } |  | ||||
| @ -1,11 +0,0 @@ | |||||
| <?php namespace App\SupportedApps\Contracts; |  | ||||
| 
 |  | ||||
| interface Livestats { |  | ||||
| 
 |  | ||||
|     public function configDetails(); |  | ||||
| 
 |  | ||||
|     public function testConfig(); |  | ||||
| 
 |  | ||||
|     public function executeConfig(); |  | ||||
|      |  | ||||
| } |  | ||||
| @ -1,12 +0,0 @@ | |||||
| <?php namespace App\SupportedApps; |  | ||||
| 
 |  | ||||
| class Duplicati implements Contracts\Applications { |  | ||||
|     public function defaultColour() |  | ||||
|     { |  | ||||
|         return '#2c3744'; |  | ||||
|     } |  | ||||
|     public function icon() |  | ||||
|     { |  | ||||
|         return 'supportedapps/duplicati.png'; |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,12 +0,0 @@ | |||||
| <?php namespace App\SupportedApps; |  | ||||
| 
 |  | ||||
| class Emby implements Contracts\Applications { |  | ||||
|     public function defaultColour() |  | ||||
|     { |  | ||||
|         return '#222'; |  | ||||
|     } |  | ||||
|     public function icon() |  | ||||
|     { |  | ||||
|         return 'supportedapps/emby.png'; |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,12 +0,0 @@ | |||||
| <?php namespace App\SupportedApps; |  | ||||
| 
 |  | ||||
| class Nextcloud implements Contracts\Applications { |  | ||||
|     public function defaultColour() |  | ||||
|     { |  | ||||
|         return '#0e2c3e'; |  | ||||
|     } |  | ||||
|     public function icon() |  | ||||
|     { |  | ||||
|         return 'supportedapps/nextcloud.png'; |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,80 +0,0 @@ | |||||
| <?php namespace App\SupportedApps; |  | ||||
| 
 |  | ||||
| use GuzzleHttp\Exception\GuzzleException; |  | ||||
| use GuzzleHttp\Client; |  | ||||
| 
 |  | ||||
| class Nzbget implements Contracts\Applications, Contracts\Livestats { |  | ||||
| 
 |  | ||||
|     public $config; |  | ||||
| 
 |  | ||||
|     public function defaultColour() |  | ||||
|     { |  | ||||
|         return '#253827'; |  | ||||
|     } |  | ||||
|     public function icon() |  | ||||
|     { |  | ||||
|         return 'supportedapps/nzbget.png'; |  | ||||
|     } |  | ||||
|     public function configDetails() |  | ||||
|     { |  | ||||
|         return 'nzbget'; |  | ||||
|     } |  | ||||
|     public function testConfig() |  | ||||
|     { |  | ||||
|         $res = $this->buildRequest('status'); |  | ||||
|         switch($res->getStatusCode()) { |  | ||||
|             case 200: |  | ||||
|                 echo 'Successfully connected to the API'; |  | ||||
|                 break; |  | ||||
|             case 401: |  | ||||
|                 echo 'Failed: Invalid credentials'; |  | ||||
|                 break; |  | ||||
|             case 404: |  | ||||
|                 echo 'Failed: Please make sure your URL is correct and that there is a trailing slash'; |  | ||||
|                 break; |  | ||||
|             default: |  | ||||
|                 echo 'Something went wrong... Code: '.$res->getStatusCode(); |  | ||||
|                 break; |  | ||||
|         } |  | ||||
|     } |  | ||||
|     public function executeConfig() |  | ||||
|     { |  | ||||
|         $output = ''; |  | ||||
|         $res = $this->buildRequest('status'); |  | ||||
|         $data = json_decode($res->getBody()); |  | ||||
|         //$data->result->RemainingSizeMB = '10000000'; |  | ||||
|         //$data->result->DownloadRate = '100000000'; |  | ||||
|         $size = $data->result->RemainingSizeMB; |  | ||||
|         $rate = $data->result->DownloadRate; |  | ||||
|         $queue_size = format_bytes($size*1000*1000, false, ' <span>', '</span>'); |  | ||||
|         $current_speed = format_bytes($rate, false, ' <span>'); |  | ||||
| 
 |  | ||||
|         if($size > 0 || $rate > 0) { |  | ||||
|             $output = ' |  | ||||
|             <ul class="livestats"> |  | ||||
|                 <li><span class="title">Queue</span><strong>'.$queue_size.'</strong></li> |  | ||||
|                 <li><span class="title">Speed</span><strong>'.$current_speed.'/s</span></strong></li> |  | ||||
|             </ul> |  | ||||
|             '; |  | ||||
|         } |  | ||||
|         return $output; |  | ||||
|     } |  | ||||
|     public function buildRequest($endpoint) |  | ||||
|     { |  | ||||
|         $config = $this->config; |  | ||||
|         $url = $config->url; |  | ||||
|         $username = $config->username; |  | ||||
|         $password = $config->password; |  | ||||
| 
 |  | ||||
|         $rebuild_url = str_replace('http://', 'http://'.$username.':'.$password.'@', $url); |  | ||||
|         $rebuild_url = str_replace('https://', 'https://'.$username.':'.$password.'@', $rebuild_url); |  | ||||
| 
 |  | ||||
|         $api_url = $rebuild_url.'jsonrpc/'.$endpoint; |  | ||||
| 
 |  | ||||
|         $client = new Client(['http_errors' => false]); |  | ||||
|         $res = $client->request('GET', $api_url); |  | ||||
|         return $res; |  | ||||
| 
 |  | ||||
|     } |  | ||||
|     |  | ||||
| } |  | ||||
| @ -1,12 +0,0 @@ | |||||
| <?php namespace App\SupportedApps; |  | ||||
| 
 |  | ||||
| class Pfsense implements Contracts\Applications { |  | ||||
|     public function defaultColour() |  | ||||
|     { |  | ||||
|         return '#4e4742'; |  | ||||
|     } |  | ||||
|     public function icon() |  | ||||
|     { |  | ||||
|         return 'supportedapps/pfsense.png'; |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,70 +0,0 @@ | |||||
| <?php namespace App\SupportedApps; |  | ||||
| 
 |  | ||||
| use GuzzleHttp\Exception\GuzzleException; |  | ||||
| use GuzzleHttp\Client; |  | ||||
| 
 |  | ||||
| class Pihole implements Contracts\Applications, Contracts\Livestats { |  | ||||
|     public function defaultColour() |  | ||||
|     { |  | ||||
|         return '#352222'; |  | ||||
|     } |  | ||||
|     public function icon() |  | ||||
|     { |  | ||||
|         return 'supportedapps/pihole.png'; |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     public function configDetails() |  | ||||
|     { |  | ||||
|         return 'pihole'; |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     public function testConfig() |  | ||||
|     { |  | ||||
|         $res = $this->buildRequest(); |  | ||||
|         switch($res->getStatusCode()) { |  | ||||
|             case 200: |  | ||||
|                 echo 'Successfully connected to the API'; |  | ||||
|                 break; |  | ||||
|             case 401: |  | ||||
|                 echo 'Failed: Invalid credentials'; |  | ||||
|                 break; |  | ||||
|             case 404: |  | ||||
|                 echo 'Failed: Please make sure your URL is correct and that there is a trailing slash'; |  | ||||
|                 break; |  | ||||
|             default: |  | ||||
|                 echo 'Something went wrong... Code: '.$res->getStatusCode(); |  | ||||
|                 break; |  | ||||
|         } |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     public function executeConfig() |  | ||||
|     { |  | ||||
|         $output = ''; |  | ||||
|         $res = $this->buildRequest(); |  | ||||
|         $data = json_decode($res->getBody()); |  | ||||
| 
 |  | ||||
|             $output = ' |  | ||||
|             <ul class="livestats"> |  | ||||
|                 <li><span class="title">Domains<br />Blocked</span><strong>'.$data->domains_being_blocked.'</strong></li> |  | ||||
|                 <li><span class="title">Blocked<br />Today</span><strong>'.$data->ads_blocked_today.'</span></strong></li> |  | ||||
|             </ul> |  | ||||
|             '; |  | ||||
|         return $output; |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     public function buildRequest() |  | ||||
|     { |  | ||||
|         $config = $this->config; |  | ||||
|         $url = $config->url; |  | ||||
| 
 |  | ||||
|         $api_url = $url.'admin/api.php'; |  | ||||
|         //die( $api_url.' --- '); |  | ||||
| 
 |  | ||||
|         $client = new Client(['http_errors' => false]); |  | ||||
|         $res = $client->request('GET', $api_url); |  | ||||
|         return $res; |  | ||||
| 
 |  | ||||
|     } |  | ||||
| 
 |  | ||||
| 
 |  | ||||
| } |  | ||||
| @ -1,12 +0,0 @@ | |||||
| <?php namespace App\SupportedApps; |  | ||||
| 
 |  | ||||
| class Plex implements Contracts\Applications { |  | ||||
|     public function defaultColour() |  | ||||
|     { |  | ||||
|         return '#222'; |  | ||||
|     } |  | ||||
|     public function icon() |  | ||||
|     { |  | ||||
|         return 'supportedapps/plex.png'; |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,12 +0,0 @@ | |||||
| <?php namespace App\SupportedApps; |  | ||||
| 
 |  | ||||
| class Plexpy implements Contracts\Applications { |  | ||||
|     public function defaultColour() |  | ||||
|     { |  | ||||
|         return '#2d2208'; |  | ||||
|     } |  | ||||
|     public function icon() |  | ||||
|     { |  | ||||
|         return 'supportedapps/plexpy.png'; |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,12 +0,0 @@ | |||||
| <?php namespace App\SupportedApps; |  | ||||
| 
 |  | ||||
| class Portainer implements Contracts\Applications { |  | ||||
|     public function defaultColour() |  | ||||
|     { |  | ||||
|         return '#283f44'; |  | ||||
|     } |  | ||||
|     public function icon() |  | ||||
|     { |  | ||||
|         return 'supportedapps/portainer.png'; |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,82 +0,0 @@ | |||||
| <?php namespace App\SupportedApps; |  | ||||
| 
 |  | ||||
| use GuzzleHttp\Exception\GuzzleException; |  | ||||
| use GuzzleHttp\Client; |  | ||||
| 
 |  | ||||
| class Sabnzbd implements Contracts\Applications, Contracts\Livestats { |  | ||||
| 
 |  | ||||
|     public $config; |  | ||||
| 
 |  | ||||
|     public function defaultColour() |  | ||||
|     { |  | ||||
|         return '#3e3924'; |  | ||||
|     } |  | ||||
|     public function icon() |  | ||||
|     { |  | ||||
|         return 'supportedapps/sabnzbd.png'; |  | ||||
|     } |  | ||||
|     public function configDetails() |  | ||||
|     { |  | ||||
|         return 'sabnzbd'; |  | ||||
|     } |  | ||||
|     public function testConfig() |  | ||||
|     { |  | ||||
|         $res = $this->buildRequest('queue'); |  | ||||
|         switch($res->getStatusCode()) { |  | ||||
|             case 200: |  | ||||
|                 $data = json_decode($res->getBody()); |  | ||||
|                 if(isset($data->error) && !empty($data->error)) { |  | ||||
|                     echo 'Failed: '.$data->error; |  | ||||
|                 } else { |  | ||||
|                     echo 'Successfully connected to the API'; |  | ||||
|                 } |  | ||||
|                 break; |  | ||||
|             case 401: |  | ||||
|                 echo 'Failed: Invalid credentials'; |  | ||||
|                 break; |  | ||||
|             case 404: |  | ||||
|                 echo 'Failed: Please make sure your URL is correct and that there is a trailing slash'; |  | ||||
|                 break; |  | ||||
|             default: |  | ||||
|                 echo 'Something went wrong... Code: '.$res->getStatusCode(); |  | ||||
|                 break; |  | ||||
|         } |  | ||||
|     } |  | ||||
|     public function executeConfig() |  | ||||
|     { |  | ||||
|         $output = ''; |  | ||||
|         $res = $this->buildRequest('queue'); |  | ||||
|         $data = json_decode($res->getBody()); |  | ||||
|         //$data->result->RemainingSizeMB = '10000000'; |  | ||||
|         //$data->result->DownloadRate = '100000000'; |  | ||||
|         $size = $data->queue->mbleft; |  | ||||
|         $rate = $data->queue->kbpersec; |  | ||||
|         $queue_size = format_bytes($size*1000*1000, false, ' <span>', '</span>'); |  | ||||
|         $current_speed = format_bytes($rate*1000, false, ' <span>'); |  | ||||
| 
 |  | ||||
|         if($size > 0 || $rate > 0) { |  | ||||
|             $output = ' |  | ||||
|             <ul class="livestats"> |  | ||||
|                 <li><span class="title">Queue</span><strong>'.$queue_size.'</strong></li> |  | ||||
|                 <li><span class="title">Speed</span><strong>'.$current_speed.'/s</span></strong></li> |  | ||||
|             </ul> |  | ||||
|             '; |  | ||||
|         } |  | ||||
|         return $output; |  | ||||
|     } |  | ||||
|     public function buildRequest($endpoint) |  | ||||
|     { |  | ||||
|         $config = $this->config; |  | ||||
|         $url = $config->url; |  | ||||
|         $apikey = $config->apikey; |  | ||||
| 
 |  | ||||
|         $api_url = $url.'api?output=json&apikey='.$apikey.'&mode='.$endpoint; |  | ||||
|         //die( $api_url.' --- '); |  | ||||
| 
 |  | ||||
|         $client = new Client(['http_errors' => false]); |  | ||||
|         $res = $client->request('GET', $api_url); |  | ||||
|         return $res; |  | ||||
| 
 |  | ||||
|     } |  | ||||
|     |  | ||||
| } |  | ||||
| @ -1,12 +0,0 @@ | |||||
| <?php namespace App\SupportedApps; |  | ||||
| 
 |  | ||||
| class Unifi implements Contracts\Applications { |  | ||||
|     public function defaultColour() |  | ||||
|     { |  | ||||
|         return '#363840'; |  | ||||
|     } |  | ||||
|     public function icon() |  | ||||
|     { |  | ||||
|         return 'supportedapps/unifi.png'; |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,29 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| namespace App; |  | ||||
| 
 |  | ||||
| use Illuminate\Notifications\Notifiable; |  | ||||
| use Illuminate\Foundation\Auth\User as Authenticatable; |  | ||||
| 
 |  | ||||
| class User extends Authenticatable |  | ||||
| { |  | ||||
|     use Notifiable; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * The attributes that are mass assignable. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $fillable = [ |  | ||||
|         'name', 'email', 'password', |  | ||||
|     ]; |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * The attributes that should be hidden for arrays. |  | ||||
|      * |  | ||||
|      * @var array |  | ||||
|      */ |  | ||||
|     protected $hidden = [ |  | ||||
|         'password', 'remember_token', |  | ||||
|     ]; |  | ||||
| } |  | ||||
| @ -1,53 +0,0 @@ | |||||
| #!/usr/bin/env php |  | ||||
| <?php |  | ||||
| 
 |  | ||||
| define('LARAVEL_START', microtime(true)); |  | ||||
| 
 |  | ||||
| /* |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | Register The Auto Loader |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | |  | ||||
| | Composer provides a convenient, automatically generated class loader |  | ||||
| | for our application. We just need to utilize it! We'll require it |  | ||||
| | into the script here so that we do not have to worry about the |  | ||||
| | loading of any our classes "manually". Feels great to relax. |  | ||||
| | |  | ||||
| */ |  | ||||
| 
 |  | ||||
| require __DIR__.'/vendor/autoload.php'; |  | ||||
| 
 |  | ||||
| $app = require_once __DIR__.'/bootstrap/app.php'; |  | ||||
| 
 |  | ||||
| /* |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | Run The Artisan Application |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | |  | ||||
| | When we run the console application, the current CLI command will be |  | ||||
| | executed in this console and the response sent back to a terminal |  | ||||
| | or another output device for the developers. Here goes nothing! |  | ||||
| | |  | ||||
| */ |  | ||||
| 
 |  | ||||
| $kernel = $app->make(Illuminate\Contracts\Console\Kernel::class); |  | ||||
| 
 |  | ||||
| $status = $kernel->handle( |  | ||||
|     $input = new Symfony\Component\Console\Input\ArgvInput, |  | ||||
|     new Symfony\Component\Console\Output\ConsoleOutput |  | ||||
| ); |  | ||||
| 
 |  | ||||
| /* |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | Shutdown The Application |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | |  | ||||
| | Once Artisan has finished running, we will fire off the shutdown events |  | ||||
| | so that any final work may be done by the application before we shut |  | ||||
| | down the process. This is the last thing to happen to the request. |  | ||||
| | |  | ||||
| */ |  | ||||
| 
 |  | ||||
| $kernel->terminate($input, $status); |  | ||||
| 
 |  | ||||
| exit($status); |  | ||||
| @ -1,55 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| /* |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | Create The Application |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | |  | ||||
| | The first thing we will do is create a new Laravel application instance |  | ||||
| | which serves as the "glue" for all the components of Laravel, and is |  | ||||
| | the IoC container for the system binding all of the various parts. |  | ||||
| | |  | ||||
| */ |  | ||||
| 
 |  | ||||
| $app = new Illuminate\Foundation\Application( |  | ||||
|     realpath(__DIR__.'/../') |  | ||||
| ); |  | ||||
| 
 |  | ||||
| /* |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | Bind Important Interfaces |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | |  | ||||
| | Next, we need to bind some important interfaces into the container so |  | ||||
| | we will be able to resolve them when needed. The kernels serve the |  | ||||
| | incoming requests to this application from both the web and CLI. |  | ||||
| | |  | ||||
| */ |  | ||||
| 
 |  | ||||
| $app->singleton( |  | ||||
|     Illuminate\Contracts\Http\Kernel::class, |  | ||||
|     App\Http\Kernel::class |  | ||||
| ); |  | ||||
| 
 |  | ||||
| $app->singleton( |  | ||||
|     Illuminate\Contracts\Console\Kernel::class, |  | ||||
|     App\Console\Kernel::class |  | ||||
| ); |  | ||||
| 
 |  | ||||
| $app->singleton( |  | ||||
|     Illuminate\Contracts\Debug\ExceptionHandler::class, |  | ||||
|     App\Exceptions\Handler::class |  | ||||
| ); |  | ||||
| 
 |  | ||||
| /* |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | Return The Application |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | |  | ||||
| | This script returns the application instance. The instance is given to |  | ||||
| | the calling script so we can separate the building of the instances |  | ||||
| | from the actual running of the application and sending responses. |  | ||||
| | |  | ||||
| */ |  | ||||
| 
 |  | ||||
| return $app; |  | ||||
| @ -1,2 +0,0 @@ | |||||
| * |  | ||||
| !.gitignore |  | ||||
| @ -1,62 +0,0 @@ | |||||
| { |  | ||||
|     "name": "laravel/laravel", |  | ||||
|     "description": "The Laravel Framework.", |  | ||||
|     "keywords": ["framework", "laravel"], |  | ||||
|     "license": "MIT", |  | ||||
|     "type": "project", |  | ||||
|     "require": { |  | ||||
|         "php": ">=7.0.0", |  | ||||
|         "fideloper/proxy": "~3.3", |  | ||||
|         "guzzlehttp/guzzle": "^6.3", |  | ||||
|         "laravel/framework": "5.5.*", |  | ||||
|         "laravel/tinker": "~1.0", |  | ||||
|         "laravelcollective/html": "^5.5" |  | ||||
|     }, |  | ||||
|     "require-dev": { |  | ||||
|         "filp/whoops": "~2.0", |  | ||||
|         "fzaninotto/faker": "~1.4", |  | ||||
|         "mockery/mockery": "~1.0", |  | ||||
|         "phpunit/phpunit": "~6.0", |  | ||||
|         "symfony/thanks": "^1.0" |  | ||||
|     }, |  | ||||
|     "autoload": { |  | ||||
|         "classmap": [ |  | ||||
|             "database/seeds", |  | ||||
|             "database/factories" |  | ||||
|         ], |  | ||||
|         "files": [ |  | ||||
|             "app/Helper.php" |  | ||||
|         ], |  | ||||
|         "psr-4": { |  | ||||
|             "App\\": "app/" |  | ||||
|         } |  | ||||
|     }, |  | ||||
|     "autoload-dev": { |  | ||||
|         "psr-4": { |  | ||||
|             "Tests\\": "tests/" |  | ||||
|         } |  | ||||
|     }, |  | ||||
|     "extra": { |  | ||||
|         "laravel": { |  | ||||
|             "dont-discover": [ |  | ||||
|             ] |  | ||||
|         } |  | ||||
|     }, |  | ||||
|     "scripts": { |  | ||||
|         "post-root-package-install": [ |  | ||||
|             "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" |  | ||||
|         ], |  | ||||
|         "post-create-project-cmd": [ |  | ||||
|             "@php artisan key:generate" |  | ||||
|         ], |  | ||||
|         "post-autoload-dump": [ |  | ||||
|             "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", |  | ||||
|             "@php artisan package:discover" |  | ||||
|         ] |  | ||||
|     }, |  | ||||
|     "config": { |  | ||||
|         "preferred-install": "dist", |  | ||||
|         "sort-packages": true, |  | ||||
|         "optimize-autoloader": true |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,234 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| return [ |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Application Name |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This value is the name of your application. This value is used when the |  | ||||
|     | framework needs to place the application's name in a notification or |  | ||||
|     | any other location as required by the application or its packages. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'name' => env('APP_NAME', 'Heimdall'),   |  | ||||
|     'version' => '1.3.0', |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Application Environment |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This value determines the "environment" your application is currently |  | ||||
|     | running in. This may determine how you prefer to configure various |  | ||||
|     | services your application utilizes. Set this in your ".env" file. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'env' => env('APP_ENV', 'production'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Application Debug Mode |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | When your application is in debug mode, detailed error messages with |  | ||||
|     | stack traces will be shown on every error that occurs within your |  | ||||
|     | application. If disabled, a simple generic error page is shown. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'debug' => env('APP_DEBUG', false), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Application URL |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This URL is used by the console to properly generate URLs when using |  | ||||
|     | the Artisan command line tool. You should set this to the root of |  | ||||
|     | your application so that it is used when running Artisan tasks. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'url' => env('APP_URL', 'http://localhost'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Application Timezone |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may specify the default timezone for your application, which |  | ||||
|     | will be used by the PHP date and date-time functions. We have gone |  | ||||
|     | ahead and set this to a sensible default for you out of the box. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'timezone' => 'UTC', |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Application Locale Configuration |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | The application locale determines the default locale that will be used |  | ||||
|     | by the translation service provider. You are free to set this value |  | ||||
|     | to any of the locales which will be supported by the application. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'locale' => 'en', |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Application Fallback Locale |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | The fallback locale determines the locale to use when the current one |  | ||||
|     | is not available. You may change the value to correspond to any of |  | ||||
|     | the language folders that are provided through your application. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'fallback_locale' => 'en', |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Encryption Key |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This key is used by the Illuminate encrypter service and should be set |  | ||||
|     | to a random, 32 character string, otherwise these encrypted strings |  | ||||
|     | will not be safe. Please do this before deploying an application! |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'key' => env('APP_KEY', 'base64:I206O8ibx+GQyRE7BeOxDobn04Mfmyyc5Ptzns/C0mY='), |  | ||||
| 
 |  | ||||
|     'cipher' => 'AES-256-CBC', |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Logging Configuration |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may configure the log settings for your application. Out of |  | ||||
|     | the box, Laravel uses the Monolog PHP logging library. This gives |  | ||||
|     | you a variety of powerful log handlers / formatters to utilize. |  | ||||
|     | |  | ||||
|     | Available Settings: "single", "daily", "syslog", "errorlog" |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'log' => env('APP_LOG', 'single'), |  | ||||
| 
 |  | ||||
|     'log_level' => env('APP_LOG_LEVEL', 'debug'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Autoloaded Service Providers |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | The service providers listed here will be automatically loaded on the |  | ||||
|     | request to your application. Feel free to add your own services to |  | ||||
|     | this array to grant expanded functionality to your applications. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'providers' => [ |  | ||||
| 
 |  | ||||
|         /* |  | ||||
|          * Laravel Framework Service Providers... |  | ||||
|          */ |  | ||||
|         Illuminate\Auth\AuthServiceProvider::class, |  | ||||
|         Illuminate\Broadcasting\BroadcastServiceProvider::class, |  | ||||
|         Illuminate\Bus\BusServiceProvider::class, |  | ||||
|         Illuminate\Cache\CacheServiceProvider::class, |  | ||||
|         Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, |  | ||||
|         Illuminate\Cookie\CookieServiceProvider::class, |  | ||||
|         Illuminate\Database\DatabaseServiceProvider::class, |  | ||||
|         Illuminate\Encryption\EncryptionServiceProvider::class, |  | ||||
|         Illuminate\Filesystem\FilesystemServiceProvider::class, |  | ||||
|         Illuminate\Foundation\Providers\FoundationServiceProvider::class, |  | ||||
|         Illuminate\Hashing\HashServiceProvider::class, |  | ||||
|         Illuminate\Mail\MailServiceProvider::class, |  | ||||
|         Illuminate\Notifications\NotificationServiceProvider::class, |  | ||||
|         Illuminate\Pagination\PaginationServiceProvider::class, |  | ||||
|         Illuminate\Pipeline\PipelineServiceProvider::class, |  | ||||
|         Illuminate\Queue\QueueServiceProvider::class, |  | ||||
|         Illuminate\Redis\RedisServiceProvider::class, |  | ||||
|         Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, |  | ||||
|         Illuminate\Session\SessionServiceProvider::class, |  | ||||
|         Illuminate\Translation\TranslationServiceProvider::class, |  | ||||
|         Illuminate\Validation\ValidationServiceProvider::class, |  | ||||
|         Illuminate\View\ViewServiceProvider::class, |  | ||||
| 
 |  | ||||
|         /* |  | ||||
|          * Package Service Providers... |  | ||||
|          */ |  | ||||
|         Collective\Html\HtmlServiceProvider::class, |  | ||||
|         /* |  | ||||
|          * Application Service Providers... |  | ||||
|          */ |  | ||||
|         App\Providers\AppServiceProvider::class, |  | ||||
|         App\Providers\AuthServiceProvider::class, |  | ||||
|         // App\Providers\BroadcastServiceProvider::class, |  | ||||
|         App\Providers\EventServiceProvider::class, |  | ||||
|         App\Providers\RouteServiceProvider::class, |  | ||||
| 
 |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Class Aliases |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This array of class aliases will be registered when this application |  | ||||
|     | is started. However, feel free to register as many as you wish as |  | ||||
|     | the aliases are "lazy" loaded so they don't hinder performance. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'aliases' => [ |  | ||||
| 
 |  | ||||
|         'App' => Illuminate\Support\Facades\App::class, |  | ||||
|         'Artisan' => Illuminate\Support\Facades\Artisan::class, |  | ||||
|         'Auth' => Illuminate\Support\Facades\Auth::class, |  | ||||
|         'Blade' => Illuminate\Support\Facades\Blade::class, |  | ||||
|         'Broadcast' => Illuminate\Support\Facades\Broadcast::class, |  | ||||
|         'Bus' => Illuminate\Support\Facades\Bus::class, |  | ||||
|         'Cache' => Illuminate\Support\Facades\Cache::class, |  | ||||
|         'Config' => Illuminate\Support\Facades\Config::class, |  | ||||
|         'Cookie' => Illuminate\Support\Facades\Cookie::class, |  | ||||
|         'Crypt' => Illuminate\Support\Facades\Crypt::class, |  | ||||
|         'DB' => Illuminate\Support\Facades\DB::class, |  | ||||
|         'Eloquent' => Illuminate\Database\Eloquent\Model::class, |  | ||||
|         'Event' => Illuminate\Support\Facades\Event::class, |  | ||||
|         'File' => Illuminate\Support\Facades\File::class, |  | ||||
|         'Form' => Collective\Html\FormFacade::class, |  | ||||
|         'Gate' => Illuminate\Support\Facades\Gate::class, |  | ||||
|         'Hash' => Illuminate\Support\Facades\Hash::class, |  | ||||
|         'Html' => Collective\Html\HtmlFacade::class, |  | ||||
|         'Lang' => Illuminate\Support\Facades\Lang::class, |  | ||||
|         'Log' => Illuminate\Support\Facades\Log::class, |  | ||||
|         'Mail' => Illuminate\Support\Facades\Mail::class, |  | ||||
|         'Notification' => Illuminate\Support\Facades\Notification::class, |  | ||||
|         'Password' => Illuminate\Support\Facades\Password::class, |  | ||||
|         'Queue' => Illuminate\Support\Facades\Queue::class, |  | ||||
|         'Redirect' => Illuminate\Support\Facades\Redirect::class, |  | ||||
|         'Redis' => Illuminate\Support\Facades\Redis::class, |  | ||||
|         'Request' => Illuminate\Support\Facades\Request::class, |  | ||||
|         'Response' => Illuminate\Support\Facades\Response::class, |  | ||||
|         'Route' => Illuminate\Support\Facades\Route::class, |  | ||||
|         'Schema' => Illuminate\Support\Facades\Schema::class, |  | ||||
|         'Session' => Illuminate\Support\Facades\Session::class, |  | ||||
|         'Storage' => Illuminate\Support\Facades\Storage::class, |  | ||||
|         'URL' => Illuminate\Support\Facades\URL::class, |  | ||||
|         'Validator' => Illuminate\Support\Facades\Validator::class, |  | ||||
|         'View' => Illuminate\Support\Facades\View::class, |  | ||||
| 
 |  | ||||
|     ], |  | ||||
| 
 |  | ||||
| ]; |  | ||||
| @ -1,102 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| return [ |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Authentication Defaults |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This option controls the default authentication "guard" and password |  | ||||
|     | reset options for your application. You may change these defaults |  | ||||
|     | as required, but they're a perfect start for most applications. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'defaults' => [ |  | ||||
|         'guard' => 'web', |  | ||||
|         'passwords' => 'users', |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Authentication Guards |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Next, you may define every authentication guard for your application. |  | ||||
|     | Of course, a great default configuration has been defined for you |  | ||||
|     | here which uses session storage and the Eloquent user provider. |  | ||||
|     | |  | ||||
|     | All authentication drivers have a user provider. This defines how the |  | ||||
|     | users are actually retrieved out of your database or other storage |  | ||||
|     | mechanisms used by this application to persist your user's data. |  | ||||
|     | |  | ||||
|     | Supported: "session", "token" |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'guards' => [ |  | ||||
|         'web' => [ |  | ||||
|             'driver' => 'session', |  | ||||
|             'provider' => 'users', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'api' => [ |  | ||||
|             'driver' => 'token', |  | ||||
|             'provider' => 'users', |  | ||||
|         ], |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | User Providers |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | All authentication drivers have a user provider. This defines how the |  | ||||
|     | users are actually retrieved out of your database or other storage |  | ||||
|     | mechanisms used by this application to persist your user's data. |  | ||||
|     | |  | ||||
|     | If you have multiple user tables or models you may configure multiple |  | ||||
|     | sources which represent each model / table. These sources may then |  | ||||
|     | be assigned to any extra authentication guards you have defined. |  | ||||
|     | |  | ||||
|     | Supported: "database", "eloquent" |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'providers' => [ |  | ||||
|         'users' => [ |  | ||||
|             'driver' => 'eloquent', |  | ||||
|             'model' => App\User::class, |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         // 'users' => [ |  | ||||
|         //     'driver' => 'database', |  | ||||
|         //     'table' => 'users', |  | ||||
|         // ], |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Resetting Passwords |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | You may specify multiple password reset configurations if you have more |  | ||||
|     | than one user table or model in the application and you want to have |  | ||||
|     | separate password reset settings based on the specific user types. |  | ||||
|     | |  | ||||
|     | The expire time is the number of minutes that the reset token should be |  | ||||
|     | considered valid. This security feature keeps tokens short-lived so |  | ||||
|     | they have less time to be guessed. You may change this as needed. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'passwords' => [ |  | ||||
|         'users' => [ |  | ||||
|             'provider' => 'users', |  | ||||
|             'table' => 'password_resets', |  | ||||
|             'expire' => 60, |  | ||||
|         ], |  | ||||
|     ], |  | ||||
| 
 |  | ||||
| ]; |  | ||||
| @ -1,59 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| return [ |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Default Broadcaster |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This option controls the default broadcaster that will be used by the |  | ||||
|     | framework when an event needs to be broadcast. You may set this to |  | ||||
|     | any of the connections defined in the "connections" array below. |  | ||||
|     | |  | ||||
|     | Supported: "pusher", "redis", "log", "null" |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'default' => env('BROADCAST_DRIVER', 'null'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Broadcast Connections |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may define all of the broadcast connections that will be used |  | ||||
|     | to broadcast events to other systems or over websockets. Samples of |  | ||||
|     | each available type of connection are provided inside this array. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'connections' => [ |  | ||||
| 
 |  | ||||
|         'pusher' => [ |  | ||||
|             'driver' => 'pusher', |  | ||||
|             'key' => env('PUSHER_APP_KEY'), |  | ||||
|             'secret' => env('PUSHER_APP_SECRET'), |  | ||||
|             'app_id' => env('PUSHER_APP_ID'), |  | ||||
|             'options' => [ |  | ||||
|                 'cluster' => env('PUSHER_APP_CLUSTER'), |  | ||||
|                 'encrypted' => true, |  | ||||
|             ], |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'redis' => [ |  | ||||
|             'driver' => 'redis', |  | ||||
|             'connection' => 'default', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'log' => [ |  | ||||
|             'driver' => 'log', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'null' => [ |  | ||||
|             'driver' => 'null', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|     ], |  | ||||
| 
 |  | ||||
| ]; |  | ||||
| @ -1,94 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| return [ |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Default Cache Store |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This option controls the default cache connection that gets used while |  | ||||
|     | using this caching library. This connection is used when another is |  | ||||
|     | not explicitly specified when executing a given caching function. |  | ||||
|     | |  | ||||
|     | Supported: "apc", "array", "database", "file", "memcached", "redis" |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'default' => env('CACHE_DRIVER', 'file'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Cache Stores |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may define all of the cache "stores" for your application as |  | ||||
|     | well as their drivers. You may even define multiple stores for the |  | ||||
|     | same cache driver to group types of items stored in your caches. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'stores' => [ |  | ||||
| 
 |  | ||||
|         'apc' => [ |  | ||||
|             'driver' => 'apc', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'array' => [ |  | ||||
|             'driver' => 'array', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'database' => [ |  | ||||
|             'driver' => 'database', |  | ||||
|             'table' => 'cache', |  | ||||
|             'connection' => null, |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'file' => [ |  | ||||
|             'driver' => 'file', |  | ||||
|             'path' => storage_path('framework/cache/data'), |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'memcached' => [ |  | ||||
|             'driver' => 'memcached', |  | ||||
|             'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), |  | ||||
|             'sasl' => [ |  | ||||
|                 env('MEMCACHED_USERNAME'), |  | ||||
|                 env('MEMCACHED_PASSWORD'), |  | ||||
|             ], |  | ||||
|             'options' => [ |  | ||||
|                 // Memcached::OPT_CONNECT_TIMEOUT  => 2000, |  | ||||
|             ], |  | ||||
|             'servers' => [ |  | ||||
|                 [ |  | ||||
|                     'host' => env('MEMCACHED_HOST', '127.0.0.1'), |  | ||||
|                     'port' => env('MEMCACHED_PORT', 11211), |  | ||||
|                     'weight' => 100, |  | ||||
|                 ], |  | ||||
|             ], |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'redis' => [ |  | ||||
|             'driver' => 'redis', |  | ||||
|             'connection' => 'default', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Cache Key Prefix |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | When utilizing a RAM based store such as APC or Memcached, there might |  | ||||
|     | be other applications utilizing the same cache. So, we'll specify a |  | ||||
|     | value to get prefixed to all our keys so we can avoid collisions. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'prefix' => env( |  | ||||
|         'CACHE_PREFIX', |  | ||||
|         str_slug(env('APP_NAME', 'laravel'), '_').'_cache' |  | ||||
|     ), |  | ||||
| 
 |  | ||||
| ]; |  | ||||
| @ -1,121 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| return [ |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Default Database Connection Name |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may specify which of the database connections below you wish |  | ||||
|     | to use as your default connection for all database work. Of course |  | ||||
|     | you may use many connections at once using the Database library. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'default' => env('DB_CONNECTION', 'sqlite'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Database Connections |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here are each of the database connections setup for your application. |  | ||||
|     | Of course, examples of configuring each database platform that is |  | ||||
|     | supported by Laravel is shown below to make development simple. |  | ||||
|     | |  | ||||
|     | |  | ||||
|     | All database work in Laravel is done through the PHP PDO facilities |  | ||||
|     | so make sure you have the driver for your particular database of |  | ||||
|     | choice installed on your machine before you begin development. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'connections' => [ |  | ||||
| 
 |  | ||||
|         'sqlite' => [ |  | ||||
|             'driver' => 'sqlite', |  | ||||
|             //'database' => env('DB_DATABASE', database_path('database.sqlite')), |  | ||||
|             'database' => database_path(env('DB_DATABASE', 'app.sqlite')), |  | ||||
|             'prefix' => '', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'mysql' => [ |  | ||||
|             'driver' => 'mysql', |  | ||||
|             'host' => env('DB_HOST', '127.0.0.1'), |  | ||||
|             'port' => env('DB_PORT', '3306'), |  | ||||
|             'database' => env('DB_DATABASE', 'forge'), |  | ||||
|             'username' => env('DB_USERNAME', 'forge'), |  | ||||
|             'password' => env('DB_PASSWORD', ''), |  | ||||
|             'unix_socket' => env('DB_SOCKET', ''), |  | ||||
|             'charset' => 'utf8mb4', |  | ||||
|             'collation' => 'utf8mb4_unicode_ci', |  | ||||
|             'prefix' => '', |  | ||||
|             'strict' => true, |  | ||||
|             'engine' => null, |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'pgsql' => [ |  | ||||
|             'driver' => 'pgsql', |  | ||||
|             'host' => env('DB_HOST', '127.0.0.1'), |  | ||||
|             'port' => env('DB_PORT', '5432'), |  | ||||
|             'database' => env('DB_DATABASE', 'forge'), |  | ||||
|             'username' => env('DB_USERNAME', 'forge'), |  | ||||
|             'password' => env('DB_PASSWORD', ''), |  | ||||
|             'charset' => 'utf8', |  | ||||
|             'prefix' => '', |  | ||||
|             'schema' => 'public', |  | ||||
|             'sslmode' => 'prefer', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'sqlsrv' => [ |  | ||||
|             'driver' => 'sqlsrv', |  | ||||
|             'host' => env('DB_HOST', 'localhost'), |  | ||||
|             'port' => env('DB_PORT', '1433'), |  | ||||
|             'database' => env('DB_DATABASE', 'forge'), |  | ||||
|             'username' => env('DB_USERNAME', 'forge'), |  | ||||
|             'password' => env('DB_PASSWORD', ''), |  | ||||
|             'charset' => 'utf8', |  | ||||
|             'prefix' => '', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Migration Repository Table |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This table keeps track of all the migrations that have already run for |  | ||||
|     | your application. Using this information, we can determine which of |  | ||||
|     | the migrations on disk haven't actually been run in the database. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'migrations' => 'migrations', |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Redis Databases |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Redis is an open source, fast, and advanced key-value store that also |  | ||||
|     | provides a richer set of commands than a typical key-value systems |  | ||||
|     | such as APC or Memcached. Laravel makes it easy to dig right in. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'redis' => [ |  | ||||
| 
 |  | ||||
|         'client' => 'predis', |  | ||||
| 
 |  | ||||
|         'default' => [ |  | ||||
|             'host' => env('REDIS_HOST', '127.0.0.1'), |  | ||||
|             'password' => env('REDIS_PASSWORD', null), |  | ||||
|             'port' => env('REDIS_PORT', 6379), |  | ||||
|             'database' => 0, |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|     ], |  | ||||
| 
 |  | ||||
| ]; |  | ||||
| @ -1,68 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| return [ |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Default Filesystem Disk |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may specify the default filesystem disk that should be used |  | ||||
|     | by the framework. The "local" disk, as well as a variety of cloud |  | ||||
|     | based disks are available to your application. Just store away! |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'default' => env('FILESYSTEM_DRIVER', 'public'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Default Cloud Filesystem Disk |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Many applications store files both locally and in the cloud. For this |  | ||||
|     | reason, you may specify a default "cloud" driver here. This driver |  | ||||
|     | will be bound as the Cloud disk implementation in the container. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'cloud' => env('FILESYSTEM_CLOUD', 's3'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Filesystem Disks |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may configure as many filesystem "disks" as you wish, and you |  | ||||
|     | may even configure multiple disks of the same driver. Defaults have |  | ||||
|     | been setup for each driver as an example of the required options. |  | ||||
|     | |  | ||||
|     | Supported Drivers: "local", "ftp", "s3", "rackspace" |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'disks' => [ |  | ||||
| 
 |  | ||||
|         'local' => [ |  | ||||
|             'driver' => 'local', |  | ||||
|             'root' => storage_path('app'), |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'public' => [ |  | ||||
|             'driver' => 'local', |  | ||||
|             'root' => storage_path('app/public'), |  | ||||
|             'url' => env('APP_URL').'/storage', |  | ||||
|             'visibility' => 'public', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         's3' => [ |  | ||||
|             'driver' => 's3', |  | ||||
|             'key' => env('AWS_ACCESS_KEY_ID'), |  | ||||
|             'secret' => env('AWS_SECRET_ACCESS_KEY'), |  | ||||
|             'region' => env('AWS_DEFAULT_REGION'), |  | ||||
|             'bucket' => env('AWS_BUCKET'), |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|     ], |  | ||||
| 
 |  | ||||
| ]; |  | ||||
| @ -1,123 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| return [ |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Mail Driver |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Laravel supports both SMTP and PHP's "mail" function as drivers for the |  | ||||
|     | sending of e-mail. You may specify which one you're using throughout |  | ||||
|     | your application here. By default, Laravel is setup for SMTP mail. |  | ||||
|     | |  | ||||
|     | Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses", |  | ||||
|     |            "sparkpost", "log", "array" |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'driver' => env('MAIL_DRIVER', 'smtp'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | SMTP Host Address |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may provide the host address of the SMTP server used by your |  | ||||
|     | applications. A default option is provided that is compatible with |  | ||||
|     | the Mailgun mail service which will provide reliable deliveries. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'host' => env('MAIL_HOST', 'smtp.mailgun.org'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | SMTP Host Port |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This is the SMTP port used by your application to deliver e-mails to |  | ||||
|     | users of the application. Like the host we have set this value to |  | ||||
|     | stay compatible with the Mailgun e-mail application by default. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'port' => env('MAIL_PORT', 587), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Global "From" Address |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | You may wish for all e-mails sent by your application to be sent from |  | ||||
|     | the same address. Here, you may specify a name and address that is |  | ||||
|     | used globally for all e-mails that are sent by your application. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'from' => [ |  | ||||
|         'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), |  | ||||
|         'name' => env('MAIL_FROM_NAME', 'Example'), |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | E-Mail Encryption Protocol |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may specify the encryption protocol that should be used when |  | ||||
|     | the application send e-mail messages. A sensible default using the |  | ||||
|     | transport layer security protocol should provide great security. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'encryption' => env('MAIL_ENCRYPTION', 'tls'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | SMTP Server Username |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | If your SMTP server requires a username for authentication, you should |  | ||||
|     | set it here. This will get used to authenticate with your server on |  | ||||
|     | connection. You may also set the "password" value below this one. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'username' => env('MAIL_USERNAME'), |  | ||||
| 
 |  | ||||
|     'password' => env('MAIL_PASSWORD'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Sendmail System Path |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | When using the "sendmail" driver to send e-mails, we will need to know |  | ||||
|     | the path to where Sendmail lives on this server. A default path has |  | ||||
|     | been provided here, which will work well on most of your systems. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'sendmail' => '/usr/sbin/sendmail -bs', |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Markdown Mail Settings |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | If you are using Markdown based email rendering, you may configure your |  | ||||
|     | theme and component paths here, allowing you to customize the design |  | ||||
|     | of the emails. Or, you may simply stick with the Laravel defaults! |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'markdown' => [ |  | ||||
|         'theme' => 'default', |  | ||||
| 
 |  | ||||
|         'paths' => [ |  | ||||
|             resource_path('views/vendor/mail'), |  | ||||
|         ], |  | ||||
|     ], |  | ||||
| 
 |  | ||||
| ]; |  | ||||
| @ -1,85 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| return [ |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Default Queue Driver |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Laravel's queue API supports an assortment of back-ends via a single |  | ||||
|     | API, giving you convenient access to each back-end using the same |  | ||||
|     | syntax for each one. Here you may set the default queue driver. |  | ||||
|     | |  | ||||
|     | Supported: "sync", "database", "beanstalkd", "sqs", "redis", "null" |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'default' => env('QUEUE_DRIVER', 'sync'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Queue Connections |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may configure the connection information for each server that |  | ||||
|     | is used by your application. A default configuration has been added |  | ||||
|     | for each back-end shipped with Laravel. You are free to add more. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'connections' => [ |  | ||||
| 
 |  | ||||
|         'sync' => [ |  | ||||
|             'driver' => 'sync', |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'database' => [ |  | ||||
|             'driver' => 'database', |  | ||||
|             'table' => 'jobs', |  | ||||
|             'queue' => 'default', |  | ||||
|             'retry_after' => 90, |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'beanstalkd' => [ |  | ||||
|             'driver' => 'beanstalkd', |  | ||||
|             'host' => 'localhost', |  | ||||
|             'queue' => 'default', |  | ||||
|             'retry_after' => 90, |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'sqs' => [ |  | ||||
|             'driver' => 'sqs', |  | ||||
|             'key' => env('SQS_KEY', 'your-public-key'), |  | ||||
|             'secret' => env('SQS_SECRET', 'your-secret-key'), |  | ||||
|             'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), |  | ||||
|             'queue' => env('SQS_QUEUE', 'your-queue-name'), |  | ||||
|             'region' => env('SQS_REGION', 'us-east-1'), |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|         'redis' => [ |  | ||||
|             'driver' => 'redis', |  | ||||
|             'connection' => 'default', |  | ||||
|             'queue' => 'default', |  | ||||
|             'retry_after' => 90, |  | ||||
|         ], |  | ||||
| 
 |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Failed Queue Jobs |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | These options configure the behavior of failed queue job logging so you |  | ||||
|     | can control which database and table are used to store the jobs that |  | ||||
|     | have failed. You may change them to any database / table you wish. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'failed' => [ |  | ||||
|         'database' => env('DB_CONNECTION', 'mysql'), |  | ||||
|         'table' => 'failed_jobs', |  | ||||
|     ], |  | ||||
| 
 |  | ||||
| ]; |  | ||||
| @ -1,38 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| return [ |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Third Party Services |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This file is for storing the credentials for third party services such |  | ||||
|     | as Stripe, Mailgun, SparkPost and others. This file provides a sane |  | ||||
|     | default location for this type of information, allowing packages |  | ||||
|     | to have a conventional place to find your various credentials. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'mailgun' => [ |  | ||||
|         'domain' => env('MAILGUN_DOMAIN'), |  | ||||
|         'secret' => env('MAILGUN_SECRET'), |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     'ses' => [ |  | ||||
|         'key' => env('SES_KEY'), |  | ||||
|         'secret' => env('SES_SECRET'), |  | ||||
|         'region' => 'us-east-1', |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     'sparkpost' => [ |  | ||||
|         'secret' => env('SPARKPOST_SECRET'), |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     'stripe' => [ |  | ||||
|         'model' => App\User::class, |  | ||||
|         'key' => env('STRIPE_KEY'), |  | ||||
|         'secret' => env('STRIPE_SECRET'), |  | ||||
|     ], |  | ||||
| 
 |  | ||||
| ]; |  | ||||
| @ -1,197 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| return [ |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Default Session Driver |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This option controls the default session "driver" that will be used on |  | ||||
|     | requests. By default, we will use the lightweight native driver but |  | ||||
|     | you may specify any of the other wonderful drivers provided here. |  | ||||
|     | |  | ||||
|     | Supported: "file", "cookie", "database", "apc", |  | ||||
|     |            "memcached", "redis", "array" |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'driver' => env('SESSION_DRIVER', 'file'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Session Lifetime |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may specify the number of minutes that you wish the session |  | ||||
|     | to be allowed to remain idle before it expires. If you want them |  | ||||
|     | to immediately expire on the browser closing, set that option. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'lifetime' => env('SESSION_LIFETIME', 120), |  | ||||
| 
 |  | ||||
|     'expire_on_close' => false, |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Session Encryption |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This option allows you to easily specify that all of your session data |  | ||||
|     | should be encrypted before it is stored. All encryption will be run |  | ||||
|     | automatically by Laravel and you can use the Session like normal. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'encrypt' => false, |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Session File Location |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | When using the native session driver, we need a location where session |  | ||||
|     | files may be stored. A default has been set for you but a different |  | ||||
|     | location may be specified. This is only needed for file sessions. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'files' => storage_path('framework/sessions'), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Session Database Connection |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | When using the "database" or "redis" session drivers, you may specify a |  | ||||
|     | connection that should be used to manage these sessions. This should |  | ||||
|     | correspond to a connection in your database configuration options. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'connection' => null, |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Session Database Table |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | When using the "database" session driver, you may specify the table we |  | ||||
|     | should use to manage the sessions. Of course, a sensible default is |  | ||||
|     | provided for you; however, you are free to change this as needed. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'table' => 'sessions', |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Session Cache Store |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | When using the "apc" or "memcached" session drivers, you may specify a |  | ||||
|     | cache store that should be used for these sessions. This value must |  | ||||
|     | correspond with one of the application's configured cache stores. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'store' => null, |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Session Sweeping Lottery |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Some session drivers must manually sweep their storage location to get |  | ||||
|     | rid of old sessions from storage. Here are the chances that it will |  | ||||
|     | happen on a given request. By default, the odds are 2 out of 100. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'lottery' => [2, 100], |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Session Cookie Name |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may change the name of the cookie used to identify a session |  | ||||
|     | instance by ID. The name specified here will get used every time a |  | ||||
|     | new session cookie is created by the framework for every driver. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'cookie' => env( |  | ||||
|         'SESSION_COOKIE', |  | ||||
|         str_slug(env('APP_NAME', 'laravel'), '_').'_session' |  | ||||
|     ), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Session Cookie Path |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | The session cookie path determines the path for which the cookie will |  | ||||
|     | be regarded as available. Typically, this will be the root path of |  | ||||
|     | your application but you are free to change this when necessary. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'path' => '/', |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Session Cookie Domain |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Here you may change the domain of the cookie used to identify a session |  | ||||
|     | in your application. This will determine which domains the cookie is |  | ||||
|     | available to in your application. A sensible default has been set. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'domain' => env('SESSION_DOMAIN', null), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | HTTPS Only Cookies |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | By setting this option to true, session cookies will only be sent back |  | ||||
|     | to the server if the browser has a HTTPS connection. This will keep |  | ||||
|     | the cookie from being sent to you if it can not be done securely. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'secure' => env('SESSION_SECURE_COOKIE', false), |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | HTTP Access Only |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Setting this value to true will prevent JavaScript from accessing the |  | ||||
|     | value of the cookie and the cookie will only be accessible through |  | ||||
|     | the HTTP protocol. You are free to modify this option if needed. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'http_only' => true, |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Same-Site Cookies |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This option determines how your cookies behave when cross-site requests |  | ||||
|     | take place, and can be used to mitigate CSRF attacks. By default, we |  | ||||
|     | do not enable this as other CSRF protection services are in place. |  | ||||
|     | |  | ||||
|     | Supported: "lax", "strict" |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'same_site' => null, |  | ||||
| 
 |  | ||||
| ]; |  | ||||
| @ -1,33 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| return [ |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | View Storage Paths |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | Most templating systems load templates from disk. Here you may specify |  | ||||
|     | an array of paths that should be checked for your views. Of course |  | ||||
|     | the usual Laravel view path has already been registered for you. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'paths' => [ |  | ||||
|         resource_path('views'), |  | ||||
|     ], |  | ||||
| 
 |  | ||||
|     /* |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | Compiled View Path |  | ||||
|     |-------------------------------------------------------------------------- |  | ||||
|     | |  | ||||
|     | This option determines where all the compiled Blade templates will be |  | ||||
|     | stored for your application. Typically, this is within the storage |  | ||||
|     | directory. However, as usual, you are free to change this value. |  | ||||
|     | |  | ||||
|     */ |  | ||||
| 
 |  | ||||
|     'compiled' => realpath(storage_path('framework/views')), |  | ||||
| 
 |  | ||||
| ]; |  | ||||
| @ -1 +0,0 @@ | |||||
| *.sqlite |  | ||||
| @ -1,23 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| use Faker\Generator as Faker; |  | ||||
| 
 |  | ||||
| /* |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | Model Factories |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | |  | ||||
| | This directory should contain each of the model factory definitions for |  | ||||
| | your application. Factories provide a convenient way to generate new |  | ||||
| | model instances for testing / seeding your application's database. |  | ||||
| | |  | ||||
| */ |  | ||||
| 
 |  | ||||
| $factory->define(App\User::class, function (Faker $faker) { |  | ||||
|     return [ |  | ||||
|         'name' => $faker->name, |  | ||||
|         'email' => $faker->unique()->safeEmail, |  | ||||
|         'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret |  | ||||
|         'remember_token' => str_random(10), |  | ||||
|     ]; |  | ||||
| }); |  | ||||
| @ -1,39 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| use Illuminate\Support\Facades\Schema; |  | ||||
| use Illuminate\Database\Schema\Blueprint; |  | ||||
| use Illuminate\Database\Migrations\Migration; |  | ||||
| 
 |  | ||||
| class CreateItemsTable extends Migration |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * Run the migrations. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function up() |  | ||||
|     { |  | ||||
|         Schema::create('items', function (Blueprint $table) { |  | ||||
|             $table->increments('id'); |  | ||||
|             $table->string('title'); |  | ||||
|             $table->string('colour')->nullable(); |  | ||||
|             $table->string('icon')->nullable(); |  | ||||
|             $table->string('url'); |  | ||||
|             $table->text('description')->nullable(); |  | ||||
|             $table->boolean('pinned')->default(false); |  | ||||
|             $table->integer('order')->default(0); |  | ||||
|             $table->softDeletes(); |  | ||||
|             $table->timestamps(); |  | ||||
|         }); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Reverse the migrations. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function down() |  | ||||
|     { |  | ||||
|         Schema::dropIfExists('items'); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,38 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| use Illuminate\Support\Facades\Schema; |  | ||||
| use Illuminate\Database\Schema\Blueprint; |  | ||||
| use Illuminate\Database\Migrations\Migration; |  | ||||
| 
 |  | ||||
| class CreateSettingsTable extends Migration |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * Run the migrations. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function up() |  | ||||
|     { |  | ||||
|         Schema::create('settings', function (Blueprint $table) { |  | ||||
|             $table->increments('id'); |  | ||||
|             $table->integer('group_id')->default(0); |  | ||||
|             $table->string('key'); |  | ||||
|             $table->string('type')->default('text'); |  | ||||
|             $table->text('options')->nullable(); |  | ||||
|             $table->string('label'); |  | ||||
|             $table->string('value')->nullable(); |  | ||||
|             $table->string('order')->default(0); |  | ||||
|             $table->boolean('system')->default(false); |  | ||||
|         }); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Reverse the migrations. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function down() |  | ||||
|     { |  | ||||
|         Schema::dropIfExists('settings'); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,32 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| use Illuminate\Support\Facades\Schema; |  | ||||
| use Illuminate\Database\Schema\Blueprint; |  | ||||
| use Illuminate\Database\Migrations\Migration; |  | ||||
| 
 |  | ||||
| class CreateSettingGroupsTable extends Migration |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * Run the migrations. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function up() |  | ||||
|     { |  | ||||
|         Schema::create('setting_groups', function (Blueprint $table) { |  | ||||
|             $table->increments('id'); |  | ||||
|             $table->string('title'); |  | ||||
|             $table->integer('order')->default(0); |  | ||||
|         }); |  | ||||
|     } |  | ||||
| 
 |  | ||||
|     /** |  | ||||
|      * Reverse the migrations. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function down() |  | ||||
|     { |  | ||||
|         Schema::dropIfExists('setting_groups'); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,16 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| use Illuminate\Database\Seeder; |  | ||||
| 
 |  | ||||
| class DatabaseSeeder extends Seeder |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * Run the database seeds. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function run() |  | ||||
|     { |  | ||||
|         $this->call(SettingsSeeder::class); |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,139 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| use Illuminate\Database\Seeder; |  | ||||
| use App\Setting; |  | ||||
| use App\SettingGroup; |  | ||||
| 
 |  | ||||
| class SettingsSeeder extends Seeder |  | ||||
| { |  | ||||
|     /** |  | ||||
|      * Run the database seeds. |  | ||||
|      * |  | ||||
|      * @return void |  | ||||
|      */ |  | ||||
|     public function run() |  | ||||
|     { |  | ||||
|         // Groups |  | ||||
|         if(!$setting_group = SettingGroup::find(1)) { |  | ||||
|             $setting_group = new SettingGroup; |  | ||||
|             $setting_group->id = 1; |  | ||||
|             $setting_group->title = 'app.settings.system'; |  | ||||
|             $setting_group->order = 0; |  | ||||
|             $setting_group->save(); |  | ||||
|         } else { |  | ||||
|             $setting_group->title = 'app.settings.system'; |  | ||||
|             $setting_group->save(); |  | ||||
|         } |  | ||||
|         if(!$setting_group = SettingGroup::find(2)) { |  | ||||
|             $setting_group = new SettingGroup; |  | ||||
|             $setting_group->id = 2; |  | ||||
|             $setting_group->title = 'app.settings.appearance'; |  | ||||
|             $setting_group->order = 1; |  | ||||
|             $setting_group->save(); |  | ||||
|         } else { |  | ||||
|             $setting_group->title = 'app.settings.appearance'; |  | ||||
|             $setting_group->save(); |  | ||||
|         } |  | ||||
|         if(!$setting_group = SettingGroup::find(3)) { |  | ||||
|             $setting_group = new SettingGroup; |  | ||||
|             $setting_group->id = 3; |  | ||||
|             $setting_group->title = 'app.settings.miscellaneous'; |  | ||||
|             $setting_group->order = 2; |  | ||||
|             $setting_group->save(); |  | ||||
|         } else { |  | ||||
|             $setting_group->title = 'app.settings.miscellaneous'; |  | ||||
|             $setting_group->save(); |  | ||||
|         } |  | ||||
| 
 |  | ||||
|         if($version = Setting::find(1)) { |  | ||||
|             $version->label = 'app.settings.version'; |  | ||||
|             $version->value = config('app.version'); |  | ||||
|             $version->save(); |  | ||||
|         } else { |  | ||||
|             $setting = new Setting; |  | ||||
|             $setting->id = 1; |  | ||||
|             $setting->group_id = 1; |  | ||||
|             $setting->key = 'version'; |  | ||||
|             $setting->type = 'text'; |  | ||||
|             $setting->label = 'app.settings.version'; |  | ||||
|             $setting->value = config('app.version'); |  | ||||
|             $setting->system = true; |  | ||||
|             $setting->save(); |  | ||||
|         } |  | ||||
| 
 |  | ||||
|         if(!$setting = Setting::find(2)) { |  | ||||
|             $setting = new Setting; |  | ||||
|             $setting->id = 2; |  | ||||
|             $setting->group_id = 2; |  | ||||
|             $setting->key = 'background_image'; |  | ||||
|             $setting->type = 'image'; |  | ||||
|             $setting->label = 'app.settings.background_image'; |  | ||||
|             $setting->save(); |  | ||||
|         } else { |  | ||||
|             $setting->label = 'app.settings.background_image'; |  | ||||
|             $setting->save(); |  | ||||
|         } |  | ||||
|         if(!$setting = Setting::find(3)) { |  | ||||
|             $setting = new Setting; |  | ||||
|             $setting->id = 3; |  | ||||
|             $setting->group_id = 3; |  | ||||
|             $setting->key = 'homepage_search'; |  | ||||
|             $setting->type = 'boolean'; |  | ||||
|             $setting->label = 'app.settings.homepage_search'; |  | ||||
|             $setting->save(); |  | ||||
|         } else { |  | ||||
|             $setting->label = 'app.settings.homepage_search'; |  | ||||
|             $setting->save(); |  | ||||
|         } |  | ||||
| 
 |  | ||||
|         $options = json_encode([ |  | ||||
|             'none' => 'app.options.none', |  | ||||
|             'google' => 'app.options.google', |  | ||||
|             'ddg' => 'app.options.ddg', |  | ||||
|             'bing' => 'app.options.bing' |  | ||||
|         ]); |  | ||||
| 
 |  | ||||
|         if(!$setting = Setting::find(4)) { |  | ||||
|              |  | ||||
|             $setting = new Setting; |  | ||||
|             $setting->id = 4; |  | ||||
|             $setting->group_id = 3; |  | ||||
|             $setting->key = 'search_provider'; |  | ||||
|             $setting->type = 'select'; |  | ||||
|             $setting->options = $options; |  | ||||
|             $setting->label = 'app.settings.search_provider'; |  | ||||
|             $setting->save(); |  | ||||
|         } else { |  | ||||
|             $setting->options = $options; |  | ||||
|             $setting->label = 'app.settings.search_provider'; |  | ||||
|             $setting->save(); |  | ||||
|         } |  | ||||
| 
 |  | ||||
| 
 |  | ||||
|         $language_options = json_encode([ |  | ||||
|             'de' => 'Deutsch (German)', |  | ||||
|             'en' => 'English', |  | ||||
|             'fi' => 'Suomi (Finnish)', |  | ||||
|             'fr' => 'Français (French)', |  | ||||
|             'sv' => 'Svenska (Swedish)', |  | ||||
|             'es' => 'Español (Spanish)', |  | ||||
|             'tr' => 'Türkçe (Turkish)', |  | ||||
|         ]); |  | ||||
|         if($languages = Setting::find(5)) { |  | ||||
|             $languages->options = $language_options; |  | ||||
|             $languages->save(); |  | ||||
|         } else { |  | ||||
|             $setting = new Setting; |  | ||||
|             $setting->id = 5; |  | ||||
|             $setting->group_id = 1; |  | ||||
|             $setting->key = 'language'; |  | ||||
|             $setting->type = 'select'; |  | ||||
|             $setting->label = 'app.settings.language'; |  | ||||
|             $setting->options = $language_options; |  | ||||
|             $setting->value = 'en'; |  | ||||
|             $setting->save(); |  | ||||
|         } |  | ||||
| 
 |  | ||||
|          |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -0,0 +1,39 @@ | |||||
|  | <!doctype html> | ||||
|  | <html lang="en"> | ||||
|  |     <head> | ||||
|  |         <meta charset="utf-8"> | ||||
|  |         <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||||
|  |         <meta name="viewport" content="width=device-width, initial-scale=1"> | ||||
|  | 
 | ||||
|  |         <title>Heimdall</title> | ||||
|  |         <link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png"> | ||||
|  |         <link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png"> | ||||
|  |         <link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png"> | ||||
|  |         <link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png"> | ||||
|  |         <link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png"> | ||||
|  |         <link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png"> | ||||
|  |         <link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png"> | ||||
|  |         <link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png"> | ||||
|  |         <link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"> | ||||
|  |         <link rel="icon" type="image/png" sizes="192x192"  href="/android-icon-192x192.png"> | ||||
|  |         <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> | ||||
|  |         <link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"> | ||||
|  |         <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> | ||||
|  |         <link rel="manifest" href="/manifest.json"> | ||||
|  |         <meta name="msapplication-TileColor" content="#ffffff"> | ||||
|  |         <meta name="msapplication-TileImage" content="/ms-icon-144x144.png"> | ||||
|  |         <meta name="theme-color" content="#ffffff"> | ||||
|  |         <link rel="stylesheet" href="/css/app.css" type="text/css" /> | ||||
|  | 
 | ||||
|  |     </head> | ||||
|  |     <body> | ||||
|  |         <div id="app"> | ||||
|  | 
 | ||||
|  |         </div> | ||||
|  |         <script src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | ||||
|  |         <script>!window.jQuery && document.write('<script src="/js/jquery-3.3.1.min.js"><\/script>')</script> | ||||
|  |         <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> | ||||
|  |         <script src="http://heimdall.test/js/app.js"></script> | ||||
|  |                  | ||||
|  |     </body> | ||||
|  | </html> | ||||
| @ -1,24 +0,0 @@ | |||||
| { |  | ||||
|     "private": true, |  | ||||
|     "scripts": { |  | ||||
|         "dev": "npm run development", |  | ||||
|         "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", |  | ||||
|         "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", |  | ||||
|         "watch-poll": "npm run watch -- --watch-poll", |  | ||||
|         "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", |  | ||||
|         "prod": "npm run production", |  | ||||
|         "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" |  | ||||
|     }, |  | ||||
|     "devDependencies": { |  | ||||
|         "axios": "^0.17", |  | ||||
|         "bootstrap-sass": "^3.3.7", |  | ||||
|         "cross-env": "^5.1.3", |  | ||||
|         "jquery": "^3.2", |  | ||||
|         "laravel-mix": "^1.0", |  | ||||
|         "lodash": "^4.17.4", |  | ||||
|         "vue": "^2.5.7" |  | ||||
|     }, |  | ||||
|     "dependencies": { |  | ||||
|         "node-sass": "^4.7.2" |  | ||||
|     } |  | ||||
| } |  | ||||
| @ -1,31 +0,0 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> |  | ||||
| <phpunit backupGlobals="false" |  | ||||
|          backupStaticAttributes="false" |  | ||||
|          bootstrap="vendor/autoload.php" |  | ||||
|          colors="true" |  | ||||
|          convertErrorsToExceptions="true" |  | ||||
|          convertNoticesToExceptions="true" |  | ||||
|          convertWarningsToExceptions="true" |  | ||||
|          processIsolation="false" |  | ||||
|          stopOnFailure="false"> |  | ||||
|     <testsuites> |  | ||||
|         <testsuite name="Feature"> |  | ||||
|             <directory suffix="Test.php">./tests/Feature</directory> |  | ||||
|         </testsuite> |  | ||||
| 
 |  | ||||
|         <testsuite name="Unit"> |  | ||||
|             <directory suffix="Test.php">./tests/Unit</directory> |  | ||||
|         </testsuite> |  | ||||
|     </testsuites> |  | ||||
|     <filter> |  | ||||
|         <whitelist processUncoveredFilesFromWhitelist="true"> |  | ||||
|             <directory suffix=".php">./app</directory> |  | ||||
|         </whitelist> |  | ||||
|     </filter> |  | ||||
|     <php> |  | ||||
|         <env name="APP_ENV" value="testing"/> |  | ||||
|         <env name="CACHE_DRIVER" value="array"/> |  | ||||
|         <env name="SESSION_DRIVER" value="array"/> |  | ||||
|         <env name="QUEUE_DRIVER" value="sync"/> |  | ||||
|     </php> |  | ||||
| </phpunit> |  | ||||
| @ -1,21 +0,0 @@ | |||||
| <IfModule mod_rewrite.c> |  | ||||
|     <IfModule mod_negotiation.c> |  | ||||
|         Options -MultiViews -Indexes |  | ||||
|     </IfModule> |  | ||||
| 
 |  | ||||
|     RewriteEngine On |  | ||||
| 
 |  | ||||
|     # Handle Authorization Header |  | ||||
|     RewriteCond %{HTTP:Authorization} . |  | ||||
|     RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] |  | ||||
| 
 |  | ||||
|     # Redirect Trailing Slashes If Not A Folder... |  | ||||
|     RewriteCond %{REQUEST_FILENAME} !-d |  | ||||
|     RewriteCond %{REQUEST_URI} (.+)/$ |  | ||||
|     RewriteRule ^ %1 [L,R=301] |  | ||||
| 
 |  | ||||
|     # Handle Front Controller... |  | ||||
|     RewriteCond %{REQUEST_FILENAME} !-d |  | ||||
|     RewriteCond %{REQUEST_FILENAME} !-f |  | ||||
|     RewriteRule ^ index.php [L] |  | ||||
| </IfModule> |  | ||||
| Before Width: | Height: | Size: 11 KiB | 
| Before Width: | Height: | Size: 14 KiB | 
| Before Width: | Height: | Size: 2.1 KiB | 
| Before Width: | Height: | Size: 2.5 KiB | 
| Before Width: | Height: | Size: 5.1 KiB | 
| Before Width: | Height: | Size: 7.1 KiB | 
| Before Width: | Height: | Size: 8.6 KiB | 
| Before Width: | Height: | Size: 9.1 KiB | 
| Before Width: | Height: | Size: 11 KiB | 
| Before Width: | Height: | Size: 12 KiB | 
| Before Width: | Height: | Size: 15 KiB | 
| Before Width: | Height: | Size: 3.0 KiB | 
| Before Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 5.1 KiB | 
| Before Width: | Height: | Size: 5.4 KiB | 
| Before Width: | Height: | Size: 15 KiB | 
| Before Width: | Height: | Size: 15 KiB | 
| @ -1,2 +0,0 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> |  | ||||
| <browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig> |  | ||||
| Before Width: | Height: | Size: 1.3 KiB | 
| Before Width: | Height: | Size: 1.9 KiB | 
| Before Width: | Height: | Size: 7.1 KiB | 
| Before Width: | Height: | Size: 1.1 KiB | 
| Before Width: | Height: | Size: 271 KiB | 
| Before Width: | Height: | Size: 5.2 KiB | 
| Before Width: | Height: | Size: 18 KiB | 
| @ -1,60 +0,0 @@ | |||||
| <?php |  | ||||
| 
 |  | ||||
| /** |  | ||||
|  * Laravel - A PHP Framework For Web Artisans |  | ||||
|  * |  | ||||
|  * @package  Laravel |  | ||||
|  * @author   Taylor Otwell <taylor@laravel.com> |  | ||||
|  */ |  | ||||
| 
 |  | ||||
| define('LARAVEL_START', microtime(true)); |  | ||||
| 
 |  | ||||
| /* |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | Register The Auto Loader |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | |  | ||||
| | Composer provides a convenient, automatically generated class loader for |  | ||||
| | our application. We just need to utilize it! We'll simply require it |  | ||||
| | into the script here so that we don't have to worry about manual |  | ||||
| | loading any of our classes later on. It feels great to relax. |  | ||||
| | |  | ||||
| */ |  | ||||
| 
 |  | ||||
| require __DIR__.'/../vendor/autoload.php'; |  | ||||
| 
 |  | ||||
| /* |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | Turn On The Lights |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | |  | ||||
| | We need to illuminate PHP development, so let us turn on the lights. |  | ||||
| | This bootstraps the framework and gets it ready for use, then it |  | ||||
| | will load up this application so that we can run it and send |  | ||||
| | the responses back to the browser and delight our users. |  | ||||
| | |  | ||||
| */ |  | ||||
| 
 |  | ||||
| $app = require_once __DIR__.'/../bootstrap/app.php'; |  | ||||
| 
 |  | ||||
| /* |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | Run The Application |  | ||||
| |-------------------------------------------------------------------------- |  | ||||
| | |  | ||||
| | Once we have the application, we can handle the incoming request |  | ||||
| | through the kernel, and send the associated response back to |  | ||||
| | the client's browser allowing them to enjoy the creative |  | ||||
| | and wonderful application we have prepared for them. |  | ||||
| | |  | ||||
| */ |  | ||||
| 
 |  | ||||
| $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); |  | ||||
| 
 |  | ||||
| $response = $kernel->handle( |  | ||||
|     $request = Illuminate\Http\Request::capture() |  | ||||
| ); |  | ||||
| 
 |  | ||||
| $response->send(); |  | ||||
| 
 |  | ||||
| $kernel->terminate($request, $response); |  | ||||