function __construct($connection_name) { $this->connection_name = $connection_name; $tk = Token::where('connection_name', $connection_name)->where('user_id', Auth::user()->id)->firstOrFail(); $pvd = Providers::where("id", $tk->provider_id)->first(); $this->provider_value = $pvd->reference_name; $this->provider_logo = $pvd->provider_logo; $this->owner = $tk->user_id; $this->token_id = $tk->id; $token = array('access_token' => $tk->access_token, 'expired_in' => $tk->expired_in, 'refresh_token' => $tk->refresh_token); $className = '\\App\\Library\\' . $this->provider_value . 'Interface'; $this->connObj = new $className((object) $token); }
/** * Bootstrap any application services. * * @return void */ public function boot() { // $conn = User::find(auth()->user()->id)->tokens->all(); view()->composer('layouts.master-index', function ($view) { $conn = User::find(auth()->user()->id)->token->all(); $logo = array(); foreach ($conn as $c) { array_push($logo, Providers::where('id', $c->provider_id)->first()); } $link = User::find(auth()->user()->id)->link->groupBy('link_name')->all(); $usr = User::find(auth()->user()->id); $view->with(['conn' => $conn, 'logo' => $logo, 'link' => $link, 'usr' => $usr]); }); }
public function showFromToken() { $link = Link::where("url", $_GET['tokens'])->first(); $root = File::roots()->where('link_id', $link->id)->first(); $usr = User::where('id', $link->user_id)->first(); $data = $root->getDescendants(); $logo = array(); foreach ($data as $d) { array_push($logo, Providers::where('id', Token::where('id', $d->token_id)->first()->provider_id)->first()->provider_logo); } return view('pages.gtl.gtl-another-seen', ['data' => (object) $data, 'logo' => $logo, 'lname' => $link->link_name, 'usr' => $usr]); // Show GatherLink Owner name na ja. }
/** * Display a listing of the resource. * * @return Response */ public function index() { $entries = Fileentry::all(); $providers = Providers::latest()->get(); return view('fileentries.index', compact('entries', 'providers')); }
function __construct($provider_value) { $this->provider_value = $provider_value; $this->provider_id = Providers::where("reference_name", $this->provider_value)->first()->id; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Providers::destroy($id); return redirect('providers'); }
/** * */ public function getConnectionList() { $tokens = User::find(Auth::user()->id)->token; $data = array(); foreach ($tokens as $tk) { $icon = Providers::where('id', $tk->provider_id)->first()->provider_logo; $d = array('connection_name' => $tk->connection_name, 'icon' => $icon); array_push($data, $d); } return json_encode($data); }