/** * Create a new job instance. * * @return void */ public function __construct($conName) { $this->connName = $conName; $this->connObj = new Provider($conName); $query = File::roots()->where('token_id', $this->connObj->getTokenId())->first(); if ($query !== null) { $this->root = $query; // $this->root->delete(); } else { $this->root = File::create(['name' => 'root', 'path' => $this->connObj->getProvider(), 'token_id' => $this->connObj->getTokenId()]); } }
public function getFirstLevel() { $que = User::find($this->usrId)->tokens; $data = collect(); foreach ($que as $d) { $root = File::roots()->where('token_id', $d->id)->first(); if ($root !== null) { $data = $data->merge($root->getImmediateDescendants()); } } return $data; }
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. }