repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
eveseat/web
src/Http/Controllers/Corporation/SummaryController.php
SummaryController.getSummary
public function getSummary(int $corporation_id) { $sheet = $this->getCorporationSheet($corporation_id); // Check if we managed to get any records for // this character. If not, redirect back with // an error. if (empty($sheet)) return redirect()->back() ...
php
public function getSummary(int $corporation_id) { $sheet = $this->getCorporationSheet($corporation_id); // Check if we managed to get any records for // this character. If not, redirect back with // an error. if (empty($sheet)) return redirect()->back() ...
[ "public", "function", "getSummary", "(", "int", "$", "corporation_id", ")", "{", "$", "sheet", "=", "$", "this", "->", "getCorporationSheet", "(", "$", "corporation_id", ")", ";", "// Check if we managed to get any records for", "// this character. If not, redirect back w...
@param $corporation_id @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
[ "@param", "$corporation_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Corporation/SummaryController.php#L41-L59
eveseat/web
src/Http/Validation/RoleAffilliation.php
RoleAffilliation.rules
public function rules() { // Instead of using the 'exists' validation rule, we opt to use // the 'in' rule. We do this because we want to add '0' as a valid // value, which will signal a wild card for either all characters // or all corporations. $character_ids = implode(','...
php
public function rules() { // Instead of using the 'exists' validation rule, we opt to use // the 'in' rule. We do this because we want to add '0' as a valid // value, which will signal a wild card for either all characters // or all corporations. $character_ids = implode(','...
[ "public", "function", "rules", "(", ")", "{", "// Instead of using the 'exists' validation rule, we opt to use", "// the 'in' rule. We do this because we want to add '0' as a valid", "// value, which will signal a wild card for either all characters", "// or all corporations.", "$", "character...
Get the validation rules that apply to the request. @return array
[ "Get", "the", "validation", "rules", "that", "apply", "to", "the", "request", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Validation/RoleAffilliation.php#L51-L73
eveseat/web
src/Notifications/EmailVerification.php
EmailVerification.toMail
public function toMail($notifiable): MailMessage { return (new MailMessage) ->success() ->subject('SeAT Account Activation') ->line( 'This email address has been used to register a SeAT account ' . 'at ' . route('home') . '. Before enablin...
php
public function toMail($notifiable): MailMessage { return (new MailMessage) ->success() ->subject('SeAT Account Activation') ->line( 'This email address has been used to register a SeAT account ' . 'at ' . route('home') . '. Before enablin...
[ "public", "function", "toMail", "(", "$", "notifiable", ")", ":", "MailMessage", "{", "return", "(", "new", "MailMessage", ")", "->", "success", "(", ")", "->", "subject", "(", "'SeAT Account Activation'", ")", "->", "line", "(", "'This email address has been us...
Get the mail representation of the notification. @param mixed $notifiable @return \Illuminate\Notifications\Messages\MailMessage
[ "Get", "the", "mail", "representation", "of", "the", "notification", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Notifications/EmailVerification.php#L65-L84
eveseat/web
src/Http/Composers/CorporationSummary.php
CorporationSummary.compose
public function compose(View $view) { $sheet = $this->getCorporationSheet( $this->request->corporation_id); $view->with('sheet', $sheet); }
php
public function compose(View $view) { $sheet = $this->getCorporationSheet( $this->request->corporation_id); $view->with('sheet', $sheet); }
[ "public", "function", "compose", "(", "View", "$", "view", ")", "{", "$", "sheet", "=", "$", "this", "->", "getCorporationSheet", "(", "$", "this", "->", "request", "->", "corporation_id", ")", ";", "$", "view", "->", "with", "(", "'sheet'", ",", "$", ...
Bind data to the view. @param View $view @return void
[ "Bind", "data", "to", "the", "view", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Composers/CorporationSummary.php#L56-L64
eveseat/web
src/database/migrations/2014_10_12_000000_create_users_table.php
CreateUsersTable.up
public function up() { Schema::create('users', function (Blueprint $table) { $table->bigInteger('id')->primary(); $table->integer('group_id'); $table->string('name')->unique(); $table->string('email')->unique()->nullable(); $table->boolean('activ...
php
public function up() { Schema::create('users', function (Blueprint $table) { $table->bigInteger('id')->primary(); $table->integer('group_id'); $table->string('name')->unique(); $table->string('email')->unique()->nullable(); $table->boolean('activ...
[ "public", "function", "up", "(", ")", "{", "Schema", "::", "create", "(", "'users'", ",", "function", "(", "Blueprint", "$", "table", ")", "{", "$", "table", "->", "bigInteger", "(", "'id'", ")", "->", "primary", "(", ")", ";", "$", "table", "->", ...
Run the migrations. @return void
[ "Run", "the", "migrations", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/database/migrations/2014_10_12_000000_create_users_table.php#L33-L52
eveseat/web
src/Http/Controllers/Character/ContactsController.php
ContactsController.getContacts
public function getContacts(int $character_id) { if(! request()->ajax()) return view('web::character.contacts'); if(! request()->has('all_linked_characters')) return response('required url parameter is missing!', 400); if(request('all_linked_characters') === 'false...
php
public function getContacts(int $character_id) { if(! request()->ajax()) return view('web::character.contacts'); if(! request()->has('all_linked_characters')) return response('required url parameter is missing!', 400); if(request('all_linked_characters') === 'false...
[ "public", "function", "getContacts", "(", "int", "$", "character_id", ")", "{", "if", "(", "!", "request", "(", ")", "->", "ajax", "(", ")", ")", "return", "view", "(", "'web::character.contacts'", ")", ";", "if", "(", "!", "request", "(", ")", "->", ...
@param int $character_id @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View @throws \Exception
[ "@param", "int", "$character_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Character/ContactsController.php#L45-L143
eveseat/web
src/Http/Controllers/Tools/JobController.php
JobController.getDispatchUpdateJob
public function getDispatchUpdateJob(int $character_id, string $job_name) { $job_classes = collect(config('web.jobnames.' . $job_name)); // If we could not find the jon to dispatch, log this as a // security event as someone might be trying something funny. if ($job_classes->isEmpt...
php
public function getDispatchUpdateJob(int $character_id, string $job_name) { $job_classes = collect(config('web.jobnames.' . $job_name)); // If we could not find the jon to dispatch, log this as a // security event as someone might be trying something funny. if ($job_classes->isEmpt...
[ "public", "function", "getDispatchUpdateJob", "(", "int", "$", "character_id", ",", "string", "$", "job_name", ")", "{", "$", "job_classes", "=", "collect", "(", "config", "(", "'web.jobnames.'", ".", "$", "job_name", ")", ")", ";", "// If we could not find the ...
@param int $character_id @param string $job_name @return \Illuminate\Http\RedirectResponse
[ "@param", "int", "$character_id", "@param", "string", "$job_name" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Tools/JobController.php#L40-L71
eveseat/web
src/Events/Logout.php
Logout.handle
public static function handle(LogoutEvent $event) { // If there is no user, do nothing. if (! $event->user) return; $event->user->login_history()->save(new UserLoginHistory([ 'source' => Request::getClientIp(), 'user_agent' => Request::header('User-A...
php
public static function handle(LogoutEvent $event) { // If there is no user, do nothing. if (! $event->user) return; $event->user->login_history()->save(new UserLoginHistory([ 'source' => Request::getClientIp(), 'user_agent' => Request::header('User-A...
[ "public", "static", "function", "handle", "(", "LogoutEvent", "$", "event", ")", "{", "// If there is no user, do nothing.", "if", "(", "!", "$", "event", "->", "user", ")", "return", ";", "$", "event", "->", "user", "->", "login_history", "(", ")", "->", ...
Write a logout history item for this user. @param \Illuminate\Auth\Events\Logout $event
[ "Write", "a", "logout", "history", "item", "for", "this", "user", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Events/Logout.php#L40-L55
eveseat/web
src/Http/Controllers/Auth/AdminLoginController.php
AdminLoginController.checkLoginToken
public function checkLoginToken(string $token) { if ($token != cache('admin_login_token')) abort(404); $user = User::whereName('admin')->first(); if (is_null($user)) return redirect()->route('auth.login') ->withErrors('The Admin user does not exist....
php
public function checkLoginToken(string $token) { if ($token != cache('admin_login_token')) abort(404); $user = User::whereName('admin')->first(); if (is_null($user)) return redirect()->route('auth.login') ->withErrors('The Admin user does not exist....
[ "public", "function", "checkLoginToken", "(", "string", "$", "token", ")", "{", "if", "(", "$", "token", "!=", "cache", "(", "'admin_login_token'", ")", ")", "abort", "(", "404", ")", ";", "$", "user", "=", "User", "::", "whereName", "(", "'admin'", ")...
Login using the cached admin user token. @param string $token @return \Illuminate\Http\RedirectResponse @throws \Exception @throws \Psr\SimpleCache\InvalidArgumentException
[ "Login", "using", "the", "cached", "admin", "user", "token", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Auth/AdminLoginController.php#L43-L61
eveseat/web
src/Models/User.php
User.delete
public function delete() { // Cleanup the user $this->login_history()->delete(); $this->affiliations()->detach(); $this->refresh_token()->forceDelete(); $this->settings()->delete(); return parent::delete(); }
php
public function delete() { // Cleanup the user $this->login_history()->delete(); $this->affiliations()->detach(); $this->refresh_token()->forceDelete(); $this->settings()->delete(); return parent::delete(); }
[ "public", "function", "delete", "(", ")", "{", "// Cleanup the user", "$", "this", "->", "login_history", "(", ")", "->", "delete", "(", ")", ";", "$", "this", "->", "affiliations", "(", ")", "->", "detach", "(", ")", ";", "$", "this", "->", "refresh_t...
Make sure we cleanup on delete. @return bool|null @throws \Exception
[ "Make", "sure", "we", "cleanup", "on", "delete", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Models/User.php#L160-L171
eveseat/web
src/database/migrations/2016_11_02_164414_add_permission_inversion_flags.php
AddPermissionInversionFlags.up
public function up() { Schema::table('group_role', function (Blueprint $table) { $table->boolean('not')->after('group_id')->default(false); }); Schema::table('permission_role', function (Blueprint $table) { $table->boolean('not')->after('role_id')->default(false);...
php
public function up() { Schema::table('group_role', function (Blueprint $table) { $table->boolean('not')->after('group_id')->default(false); }); Schema::table('permission_role', function (Blueprint $table) { $table->boolean('not')->after('role_id')->default(false);...
[ "public", "function", "up", "(", ")", "{", "Schema", "::", "table", "(", "'group_role'", ",", "function", "(", "Blueprint", "$", "table", ")", "{", "$", "table", "->", "boolean", "(", "'not'", ")", "->", "after", "(", "'group_id'", ")", "->", "default"...
Run the migrations. @return void
[ "Run", "the", "migrations", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/database/migrations/2016_11_02_164414_add_permission_inversion_flags.php#L34-L56
eveseat/web
src/database/migrations/2016_11_02_164414_add_permission_inversion_flags.php
AddPermissionInversionFlags.down
public function down() { Schema::table('group_role', function (Blueprint $table) { $table->dropColumn('not'); }); Schema::table('permission_role', function (Blueprint $table) { $table->dropColumn('not'); }); Schema::table('affiliation_user', funct...
php
public function down() { Schema::table('group_role', function (Blueprint $table) { $table->dropColumn('not'); }); Schema::table('permission_role', function (Blueprint $table) { $table->dropColumn('not'); }); Schema::table('affiliation_user', funct...
[ "public", "function", "down", "(", ")", "{", "Schema", "::", "table", "(", "'group_role'", ",", "function", "(", "Blueprint", "$", "table", ")", "{", "$", "table", "->", "dropColumn", "(", "'not'", ")", ";", "}", ")", ";", "Schema", "::", "table", "(...
Reverse the migrations. @return void
[ "Reverse", "the", "migrations", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/database/migrations/2016_11_02_164414_add_permission_inversion_flags.php#L63-L85
eveseat/web
src/Http/Controllers/Corporation/ContactsController.php
ContactsController.getContacts
public function getContacts(int $corporation_id) { $contacts = $this->getCorporationContacts($corporation_id); $labels = $this->getCorporationContactLabels($corporation_id); return view('web::corporation.contacts', compact('contacts', 'labels')); }
php
public function getContacts(int $corporation_id) { $contacts = $this->getCorporationContacts($corporation_id); $labels = $this->getCorporationContactLabels($corporation_id); return view('web::corporation.contacts', compact('contacts', 'labels')); }
[ "public", "function", "getContacts", "(", "int", "$", "corporation_id", ")", "{", "$", "contacts", "=", "$", "this", "->", "getCorporationContacts", "(", "$", "corporation_id", ")", ";", "$", "labels", "=", "$", "this", "->", "getCorporationContactLabels", "("...
@param $corporation_id @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
[ "@param", "$corporation_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Corporation/ContactsController.php#L37-L44
eveseat/web
src/Http/Controllers/Support/ResolveController.php
ResolveController.resolveIdsToNames
public function resolveIdsToNames(Request $request) { // Resolve the Esi client library from the IoC $eseye = app('esi-client')->get(); // Grab the ids from the request for processing collect(explode(',', $request->ids)) ->map(function ($id) { // Conver...
php
public function resolveIdsToNames(Request $request) { // Resolve the Esi client library from the IoC $eseye = app('esi-client')->get(); // Grab the ids from the request for processing collect(explode(',', $request->ids)) ->map(function ($id) { // Conver...
[ "public", "function", "resolveIdsToNames", "(", "Request", "$", "request", ")", "{", "// Resolve the Esi client library from the IoC", "$", "eseye", "=", "app", "(", "'esi-client'", ")", "->", "get", "(", ")", ";", "// Grab the ids from the request for processing", "col...
@param \Illuminate\Http\Request $request @return \Illuminate\Http\JsonResponse @throws \Exception
[ "@param", "\\", "Illuminate", "\\", "Http", "\\", "Request", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Support/ResolveController.php#L67-L134
eveseat/web
src/Http/Controllers/Support/ResolveController.php
ResolveController.resolveFactionIDs
private function resolveFactionIDs(Collection $ids) { // universe resolver is not working on factions at this time // retrieve them from SDE and remove them from collection $names = UniverseName::whereIn('entity_id', $ids->flatten()->toArray()) ->get() ->map(function...
php
private function resolveFactionIDs(Collection $ids) { // universe resolver is not working on factions at this time // retrieve them from SDE and remove them from collection $names = UniverseName::whereIn('entity_id', $ids->flatten()->toArray()) ->get() ->map(function...
[ "private", "function", "resolveFactionIDs", "(", "Collection", "$", "ids", ")", "{", "// universe resolver is not working on factions at this time", "// retrieve them from SDE and remove them from collection", "$", "names", "=", "UniverseName", "::", "whereIn", "(", "'entity_id'"...
Resolve received sets of ids with the help of chrFactions table map the resolved names, cache the results and return unresolved ids. @param \Illuminate\Support\Collection $ids @return \Illuminate\Support\Collection collection of ids that were unable to be resolved within this function
[ "Resolve", "received", "sets", "of", "ids", "with", "the", "help", "of", "chrFactions", "table", "map", "the", "resolved", "names", "cache", "the", "results", "and", "return", "unresolved", "ids", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Support/ResolveController.php#L143-L159
eveseat/web
src/Http/Controllers/Support/ResolveController.php
ResolveController.resolveInternalCharacterIDs
private function resolveInternalCharacterIDs(Collection $ids) { // resolve names that are already in SeAT // no unnecessary api calls the request can be resolved internally. $names = CharacterInfo::whereIn('character_id', $ids->flatten()->toArray()) ->get() ->map(fun...
php
private function resolveInternalCharacterIDs(Collection $ids) { // resolve names that are already in SeAT // no unnecessary api calls the request can be resolved internally. $names = CharacterInfo::whereIn('character_id', $ids->flatten()->toArray()) ->get() ->map(fun...
[ "private", "function", "resolveInternalCharacterIDs", "(", "Collection", "$", "ids", ")", "{", "// resolve names that are already in SeAT", "// no unnecessary api calls the request can be resolved internally.", "$", "names", "=", "CharacterInfo", "::", "whereIn", "(", "'character...
Resolve received sets of ids with the help of character_infos table map the resolved names, cache the results and return unresolved ids. @param \Illuminate\Support\Collection $ids @return \Illuminate\Support\Collection collection of ids that were unable to be resolved within this function
[ "Resolve", "received", "sets", "of", "ids", "with", "the", "help", "of", "character_infos", "table", "map", "the", "resolved", "names", "cache", "the", "results", "and", "return", "unresolved", "ids", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Support/ResolveController.php#L192-L208
eveseat/web
src/Http/Controllers/Support/ResolveController.php
ResolveController.resolveInternalCorporationIDs
private function resolveInternalCorporationIDs(Collection $ids) { // resolve names that are already in SeAT // no unnecessary api calls the request can be resolved internally. $names = CorporationInfo::whereIn('corporation_id', $ids->flatten()->toArray()) ->get() ->m...
php
private function resolveInternalCorporationIDs(Collection $ids) { // resolve names that are already in SeAT // no unnecessary api calls the request can be resolved internally. $names = CorporationInfo::whereIn('corporation_id', $ids->flatten()->toArray()) ->get() ->m...
[ "private", "function", "resolveInternalCorporationIDs", "(", "Collection", "$", "ids", ")", "{", "// resolve names that are already in SeAT", "// no unnecessary api calls the request can be resolved internally.", "$", "names", "=", "CorporationInfo", "::", "whereIn", "(", "'corpo...
Resolve received sets of ids with the help of corporation_infos table map the resolved names, cache the results and return unresolved ids. @param \Illuminate\Support\Collection $ids @return \Illuminate\Support\Collection collection of ids that were unable to be resolved within this function
[ "Resolve", "received", "sets", "of", "ids", "with", "the", "help", "of", "corporation_infos", "table", "map", "the", "resolved", "names", "cache", "the", "results", "and", "return", "unresolved", "ids", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Support/ResolveController.php#L217-L233
eveseat/web
src/Http/Controllers/Support/ResolveController.php
ResolveController.resolveIDsfromESI
private function resolveIDsfromESI(Collection $ids, $eseye) { // Finally, grab outstanding ids and resolve their names // using Esi. try { $eseye->setVersion('v3'); $eseye->setBody($ids->flatten()->toArray()); $names = $eseye->invoke('post', '/universe/n...
php
private function resolveIDsfromESI(Collection $ids, $eseye) { // Finally, grab outstanding ids and resolve their names // using Esi. try { $eseye->setVersion('v3'); $eseye->setBody($ids->flatten()->toArray()); $names = $eseye->invoke('post', '/universe/n...
[ "private", "function", "resolveIDsfromESI", "(", "Collection", "$", "ids", ",", "$", "eseye", ")", "{", "// Finally, grab outstanding ids and resolve their names", "// using Esi.", "try", "{", "$", "eseye", "->", "setVersion", "(", "'v3'", ")", ";", "$", "eseye", ...
Resolve given set of ids with the help of eseye client and ESI using a boolean algorithm if one of the ids in the collection of ids is invalid. If name could be resolved, save the name to universe_names table. @param \Illuminate\Support\Collection $ids @param $eseye
[ "Resolve", "given", "set", "of", "ids", "with", "the", "help", "of", "eseye", "client", "and", "ESI", "using", "a", "boolean", "algorithm", "if", "one", "of", "the", "ids", "in", "the", "collection", "of", "ids", "is", "invalid", ".", "If", "name", "co...
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Support/ResolveController.php#L244-L290
eveseat/web
src/Http/Controllers/Support/ResolveController.php
ResolveController.cacheIDsAndReturnUnresolvedIDs
private function cacheIDsAndReturnUnresolvedIDs(Collection $names, Collection $ids) : Collection { $names->each(function ($name) { cache([$this->prefix . $name['id'] => $name['name']], carbon()->addCentury()); $this->response[$name['id']] = $name['name']; UniverseName::...
php
private function cacheIDsAndReturnUnresolvedIDs(Collection $names, Collection $ids) : Collection { $names->each(function ($name) { cache([$this->prefix . $name['id'] => $name['name']], carbon()->addCentury()); $this->response[$name['id']] = $name['name']; UniverseName::...
[ "private", "function", "cacheIDsAndReturnUnresolvedIDs", "(", "Collection", "$", "names", ",", "Collection", "$", "ids", ")", ":", "Collection", "{", "$", "names", "->", "each", "(", "function", "(", "$", "name", ")", "{", "cache", "(", "[", "$", "this", ...
Cache and save resolved IDs. Return unresolved collection of ids. @param \Illuminate\Support\Collection $names resolved names @param \Illuminate\Support\Collection $ids @return \Illuminate\Support\Collection unresolved collection of ids
[ "Cache", "and", "save", "resolved", "IDs", ".", "Return", "unresolved", "collection", "of", "ids", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Support/ResolveController.php#L300-L322
eveseat/web
src/Http/Validation/SeatSettings.php
SeatSettings.rules
public function rules() { $allowed_registration = implode(',', Seat::$options['registration']); $allowed_cleanup = implode(',', Seat::$options['cleanup_data']); $allowed_tracking = implode(',', Seat::$options['allow_tracking']); return [ 'registration' => 'required|in...
php
public function rules() { $allowed_registration = implode(',', Seat::$options['registration']); $allowed_cleanup = implode(',', Seat::$options['cleanup_data']); $allowed_tracking = implode(',', Seat::$options['allow_tracking']); return [ 'registration' => 'required|in...
[ "public", "function", "rules", "(", ")", "{", "$", "allowed_registration", "=", "implode", "(", "','", ",", "Seat", "::", "$", "options", "[", "'registration'", "]", ")", ";", "$", "allowed_cleanup", "=", "implode", "(", "','", ",", "Seat", "::", "$", ...
Get the validation rules that apply to the request. @return array
[ "Get", "the", "validation", "rules", "that", "apply", "to", "the", "request", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Validation/SeatSettings.php#L50-L63
eveseat/web
src/Http/Validation/NewSchedule.php
NewSchedule.rules
public function rules() { $available_commands = implode(',', array_keys(Artisan::all())); return [ 'command' => 'required|in:' . $available_commands, 'expression' => 'required|cron|unique:schedules,expression,NULL,NULL,command,' . $this->request->get('co...
php
public function rules() { $available_commands = implode(',', array_keys(Artisan::all())); return [ 'command' => 'required|in:' . $available_commands, 'expression' => 'required|cron|unique:schedules,expression,NULL,NULL,command,' . $this->request->get('co...
[ "public", "function", "rules", "(", ")", "{", "$", "available_commands", "=", "implode", "(", "','", ",", "array_keys", "(", "Artisan", "::", "all", "(", ")", ")", ")", ";", "return", "[", "'command'", "=>", "'required|in:'", ".", "$", "available_commands"...
Get the validation rules that apply to the request. I have to admit, the Laravel docs is super shit when it comes to the unique condition with a where clause. After reading a number of crap posts online, I think I finally figured it out. Lies! **I have no idea how it works**, but for sanity sake, here is the query th...
[ "Get", "the", "validation", "rules", "that", "apply", "to", "the", "request", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Validation/NewSchedule.php#L78-L89
eveseat/web
src/Http/Validation/Custom/Cron.php
Cron.validate
public function validate($attribute, $value, $parameters, $validator) { // Try create a new CronExpression factory. If // this fails, we can assume the expression // itself is invalid/malformed. try { CronExpression::factory($value); } catch (InvalidArgumentExc...
php
public function validate($attribute, $value, $parameters, $validator) { // Try create a new CronExpression factory. If // this fails, we can assume the expression // itself is invalid/malformed. try { CronExpression::factory($value); } catch (InvalidArgumentExc...
[ "public", "function", "validate", "(", "$", "attribute", ",", "$", "value", ",", "$", "parameters", ",", "$", "validator", ")", "{", "// Try create a new CronExpression factory. If", "// this fails, we can assume the expression", "// itself is invalid/malformed.", "try", "{...
Validate if the $value is a valid cron expression. @param $attribute @param $value @param $parameters @param $validator @return bool
[ "Validate", "if", "the", "$value", "is", "a", "valid", "cron", "expression", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Validation/Custom/Cron.php#L44-L61
eveseat/web
src/Http/Composers/Esi.php
Esi.compose
public function compose(View $view) { $view->with('esi_status', EsiStatus::latest()->first()); $view->with('is_rate_limited', $this->isEsiRateLimited()); $view->with('rate_limit_ttl', $this->getRateLimitKeyTtl()); }
php
public function compose(View $view) { $view->with('esi_status', EsiStatus::latest()->first()); $view->with('is_rate_limited', $this->isEsiRateLimited()); $view->with('rate_limit_ttl', $this->getRateLimitKeyTtl()); }
[ "public", "function", "compose", "(", "View", "$", "view", ")", "{", "$", "view", "->", "with", "(", "'esi_status'", ",", "EsiStatus", "::", "latest", "(", ")", "->", "first", "(", ")", ")", ";", "$", "view", "->", "with", "(", "'is_rate_limited'", "...
Bind data to the view. @param View $view @return void @throws \Exception
[ "Bind", "data", "to", "the", "view", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Composers/Esi.php#L46-L52
eveseat/web
src/Http/Controllers/Corporation/IndustryController.php
IndustryController.getIndustryData
public function getIndustryData(int $corporation_id) { $jobs = $this->getCorporationIndustry($corporation_id, false); return Datatables::of($jobs) ->editColumn('installer_id', function ($row) { return view('web::partials.industryinstaller', compact('row')) ...
php
public function getIndustryData(int $corporation_id) { $jobs = $this->getCorporationIndustry($corporation_id, false); return Datatables::of($jobs) ->editColumn('installer_id', function ($row) { return view('web::partials.industryinstaller', compact('row')) ...
[ "public", "function", "getIndustryData", "(", "int", "$", "corporation_id", ")", "{", "$", "jobs", "=", "$", "this", "->", "getCorporationIndustry", "(", "$", "corporation_id", ",", "false", ")", ";", "return", "Datatables", "::", "of", "(", "$", "jobs", "...
@param int $corporation_id @return mixed @throws \Exception
[ "@param", "int", "$corporation_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Corporation/IndustryController.php#L54-L83
eveseat/web
src/Http/Controllers/Profile/ProfileController.php
ProfileController.getUpdateUserSettings
public function getUpdateUserSettings(ProfileSettings $request) { // Update the rest of the settings Profile::set('main_character_id', $request->main_character_id); Profile::set('skin', $request->skin); Profile::set('language', $request->language); Profile::set('sidebar', $r...
php
public function getUpdateUserSettings(ProfileSettings $request) { // Update the rest of the settings Profile::set('main_character_id', $request->main_character_id); Profile::set('skin', $request->skin); Profile::set('language', $request->language); Profile::set('sidebar', $r...
[ "public", "function", "getUpdateUserSettings", "(", "ProfileSettings", "$", "request", ")", "{", "// Update the rest of the settings", "Profile", "::", "set", "(", "'main_character_id'", ",", "$", "request", "->", "main_character_id", ")", ";", "Profile", "::", "set",...
@param \Seat\Web\Http\Validation\ProfileSettings $request @return \Illuminate\Http\RedirectResponse @throws \Seat\Services\Exceptions\SettingException
[ "@param", "\\", "Seat", "\\", "Web", "\\", "Http", "\\", "Validation", "\\", "ProfileSettings", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Profile/ProfileController.php#L72-L89
eveseat/web
src/Http/Controllers/Profile/ProfileController.php
ProfileController.postUpdateEmail
public function postUpdateEmail(EmailUpdate $request) { Profile::set('email_address', $request->new_email); return redirect()->back() ->with('success', 'Email updated!'); }
php
public function postUpdateEmail(EmailUpdate $request) { Profile::set('email_address', $request->new_email); return redirect()->back() ->with('success', 'Email updated!'); }
[ "public", "function", "postUpdateEmail", "(", "EmailUpdate", "$", "request", ")", "{", "Profile", "::", "set", "(", "'email_address'", ",", "$", "request", "->", "new_email", ")", ";", "return", "redirect", "(", ")", "->", "back", "(", ")", "->", "with", ...
@param \Seat\Web\Http\Validation\EmailUpdate $request @return \Illuminate\Http\RedirectResponse @throws \Seat\Services\Exceptions\SettingException
[ "@param", "\\", "Seat", "\\", "Web", "\\", "Http", "\\", "Validation", "\\", "EmailUpdate", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Profile/ProfileController.php#L97-L104
eveseat/web
src/Http/Controllers/Profile/ProfileController.php
ProfileController.getChangeCharacter
public function getChangeCharacter(int $character_id) { $user_characters = $this->getUserGroupCharacters( auth()->user()->group)->pluck('id'); // Prevent logins to arbitrary characters. if (! $user_characters->contains($character_id)) { // Log this attempt ...
php
public function getChangeCharacter(int $character_id) { $user_characters = $this->getUserGroupCharacters( auth()->user()->group)->pluck('id'); // Prevent logins to arbitrary characters. if (! $user_characters->contains($character_id)) { // Log this attempt ...
[ "public", "function", "getChangeCharacter", "(", "int", "$", "character_id", ")", "{", "$", "user_characters", "=", "$", "this", "->", "getUserGroupCharacters", "(", "auth", "(", ")", "->", "user", "(", ")", "->", "group", ")", "->", "pluck", "(", "'id'", ...
@param int $character_id @return \Illuminate\Http\RedirectResponse
[ "@param", "int", "$character_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Profile/ProfileController.php#L111-L137
eveseat/web
src/Http/Controllers/Auth/EmailController.php
EmailController.confirmEmail
public function confirmEmail($token) { $user = User::whereActivationToken($token)->firstOrFail(); $user->confirmEmail(); auth()->login($user); return redirect()->intended() ->with('success', 'Email verified!'); }
php
public function confirmEmail($token) { $user = User::whereActivationToken($token)->firstOrFail(); $user->confirmEmail(); auth()->login($user); return redirect()->intended() ->with('success', 'Email verified!'); }
[ "public", "function", "confirmEmail", "(", "$", "token", ")", "{", "$", "user", "=", "User", "::", "whereActivationToken", "(", "$", "token", ")", "->", "firstOrFail", "(", ")", ";", "$", "user", "->", "confirmEmail", "(", ")", ";", "auth", "(", ")", ...
@param $token @return \Illuminate\Http\RedirectResponse
[ "@param", "$token" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Auth/EmailController.php#L39-L50
eveseat/web
src/Http/Controllers/Configuration/ScheduleController.php
ScheduleController.newSchedule
public function newSchedule(NewSchedule $request) { Schedule::create($request->all()); return redirect()->back() ->with('success', 'New Schedule has been added!'); }
php
public function newSchedule(NewSchedule $request) { Schedule::create($request->all()); return redirect()->back() ->with('success', 'New Schedule has been added!'); }
[ "public", "function", "newSchedule", "(", "NewSchedule", "$", "request", ")", "{", "Schedule", "::", "create", "(", "$", "request", "->", "all", "(", ")", ")", ";", "return", "redirect", "(", ")", "->", "back", "(", ")", "->", "with", "(", "'success'",...
@param \Seat\Web\Http\Validation\NewSchedule $request @return \Illuminate\Http\RedirectResponse
[ "@param", "\\", "Seat", "\\", "Web", "\\", "Http", "\\", "Validation", "\\", "NewSchedule", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/ScheduleController.php#L66-L74
eveseat/web
src/Http/Controllers/Character/PiController.php
PiController.getPi
public function getPi(int $character_id) { $colonies = $this->getCharacterPlanetaryColonies($character_id); $extractors = $this->getCharacterPlanetaryExtractors($character_id); // TODO: Complete the Links and stuff™ return view('web::character.pi', compact('colonies', 'extractors'...
php
public function getPi(int $character_id) { $colonies = $this->getCharacterPlanetaryColonies($character_id); $extractors = $this->getCharacterPlanetaryExtractors($character_id); // TODO: Complete the Links and stuff™ return view('web::character.pi', compact('colonies', 'extractors'...
[ "public", "function", "getPi", "(", "int", "$", "character_id", ")", "{", "$", "colonies", "=", "$", "this", "->", "getCharacterPlanetaryColonies", "(", "$", "character_id", ")", ";", "$", "extractors", "=", "$", "this", "->", "getCharacterPlanetaryExtractors", ...
@param $character_id @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
[ "@param", "$character_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Character/PiController.php#L37-L46
eveseat/web
src/Http/Controllers/Corporation/AssetsController.php
AssetsController.getAssets
public function getAssets(int $corporation_id) { $divisions = $this->getCorporationDivisions($corporation_id); $assets = $this->getCorporationAssets($corporation_id); return view('web::corporation.assets', compact('divisions', 'assets')); }
php
public function getAssets(int $corporation_id) { $divisions = $this->getCorporationDivisions($corporation_id); $assets = $this->getCorporationAssets($corporation_id); return view('web::corporation.assets', compact('divisions', 'assets')); }
[ "public", "function", "getAssets", "(", "int", "$", "corporation_id", ")", "{", "$", "divisions", "=", "$", "this", "->", "getCorporationDivisions", "(", "$", "corporation_id", ")", ";", "$", "assets", "=", "$", "this", "->", "getCorporationAssets", "(", "$"...
@param $corporation_id @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
[ "@param", "$corporation_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Corporation/AssetsController.php#L42-L49
eveseat/web
src/Http/Controllers/Corporation/AssetsController.php
AssetsController.getAssetsContents
public function getAssetsContents(int $corporation_id, int $item_id) { $contents = $this->getCorporationAssetContents($corporation_id, $item_id); return view('web::partials.assetscontents', compact('contents')); }
php
public function getAssetsContents(int $corporation_id, int $item_id) { $contents = $this->getCorporationAssetContents($corporation_id, $item_id); return view('web::partials.assetscontents', compact('contents')); }
[ "public", "function", "getAssetsContents", "(", "int", "$", "corporation_id", ",", "int", "$", "item_id", ")", "{", "$", "contents", "=", "$", "this", "->", "getCorporationAssetContents", "(", "$", "corporation_id", ",", "$", "item_id", ")", ";", "return", "...
@param int $corporation_id @param int $item_id @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
[ "@param", "int", "$corporation_id", "@param", "int", "$item_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Corporation/AssetsController.php#L57-L63
eveseat/web
src/Http/Controllers/Tools/StandingsController.php
StandingsController.postNewStanding
public function postNewStanding(StandingsBuilder $request) { StandingsProfile::create([ 'name' => $request->input('name'), ]); return redirect()->back() ->with('success', 'Created!'); }
php
public function postNewStanding(StandingsBuilder $request) { StandingsProfile::create([ 'name' => $request->input('name'), ]); return redirect()->back() ->with('success', 'Created!'); }
[ "public", "function", "postNewStanding", "(", "StandingsBuilder", "$", "request", ")", "{", "StandingsProfile", "::", "create", "(", "[", "'name'", "=>", "$", "request", "->", "input", "(", "'name'", ")", ",", "]", ")", ";", "return", "redirect", "(", ")",...
@param \Seat\Web\Http\Validation\StandingsBuilder $request @return \Illuminate\Http\RedirectResponse
[ "@param", "\\", "Seat", "\\", "Web", "\\", "Http", "\\", "Validation", "\\", "StandingsBuilder", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Tools/StandingsController.php#L69-L79
eveseat/web
src/Http/Controllers/Tools/StandingsController.php
StandingsController.getDeleteStandingsProfile
public function getDeleteStandingsProfile(int $profile_id) { $standing = StandingsProfile::findOrFail($profile_id); $standing->delete(); return redirect()->back() ->with('success', 'Standings profile deleted.'); }
php
public function getDeleteStandingsProfile(int $profile_id) { $standing = StandingsProfile::findOrFail($profile_id); $standing->delete(); return redirect()->back() ->with('success', 'Standings profile deleted.'); }
[ "public", "function", "getDeleteStandingsProfile", "(", "int", "$", "profile_id", ")", "{", "$", "standing", "=", "StandingsProfile", "::", "findOrFail", "(", "$", "profile_id", ")", ";", "$", "standing", "->", "delete", "(", ")", ";", "return", "redirect", ...
@param int $profile_id @return \Illuminate\Http\RedirectResponse
[ "@param", "int", "$profile_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Tools/StandingsController.php#L86-L94
eveseat/web
src/Http/Controllers/Tools/StandingsController.php
StandingsController.getStandingEdit
public function getStandingEdit(int $id) { $standing = StandingsProfile::with('standings') ->where('id', $id) ->first(); $characters = $this->getAllCharactersWithAffiliations(); $corporations = $this->getAllCorporationsWithAffiliationsAndFilters(); return v...
php
public function getStandingEdit(int $id) { $standing = StandingsProfile::with('standings') ->where('id', $id) ->first(); $characters = $this->getAllCharactersWithAffiliations(); $corporations = $this->getAllCorporationsWithAffiliationsAndFilters(); return v...
[ "public", "function", "getStandingEdit", "(", "int", "$", "id", ")", "{", "$", "standing", "=", "StandingsProfile", "::", "with", "(", "'standings'", ")", "->", "where", "(", "'id'", ",", "$", "id", ")", "->", "first", "(", ")", ";", "$", "characters",...
@param int $id @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
[ "@param", "int", "$id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Tools/StandingsController.php#L101-L113
eveseat/web
src/Http/Controllers/Tools/StandingsController.php
StandingsController.getStandingsAjaxElementName
public function getStandingsAjaxElementName(Request $request) { $response = [ 'results' => [], ]; if (strlen($request->input('search')) > 0) { try { // Resolve the Esi client library from the IoC $eseye = app('esi-client')->get(); ...
php
public function getStandingsAjaxElementName(Request $request) { $response = [ 'results' => [], ]; if (strlen($request->input('search')) > 0) { try { // Resolve the Esi client library from the IoC $eseye = app('esi-client')->get(); ...
[ "public", "function", "getStandingsAjaxElementName", "(", "Request", "$", "request", ")", "{", "$", "response", "=", "[", "'results'", "=>", "[", "]", ",", "]", ";", "if", "(", "strlen", "(", "$", "request", "->", "input", "(", "'search'", ")", ")", ">...
@param \Illuminate\Http\Request $request @return \Illuminate\Http\JsonResponse
[ "@param", "\\", "Illuminate", "\\", "Http", "\\", "Request", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Tools/StandingsController.php#L120-L191
eveseat/web
src/Http/Controllers/Tools/StandingsController.php
StandingsController.postAddElementToStanding
public function postAddElementToStanding(StandingsElementAdd $request) { $element_id = $request->input('element_id'); $type = $request->input('type'); $standing = $request->input('standing'); // Ensure that the element we got is one what we managed // to resolve earlier. ...
php
public function postAddElementToStanding(StandingsElementAdd $request) { $element_id = $request->input('element_id'); $type = $request->input('type'); $standing = $request->input('standing'); // Ensure that the element we got is one what we managed // to resolve earlier. ...
[ "public", "function", "postAddElementToStanding", "(", "StandingsElementAdd", "$", "request", ")", "{", "$", "element_id", "=", "$", "request", "->", "input", "(", "'element_id'", ")", ";", "$", "type", "=", "$", "request", "->", "input", "(", "'type'", ")",...
@param \Seat\Web\Http\Validation\StandingsElementAdd $request @return \Illuminate\Http\RedirectResponse @throws \Exception
[ "@param", "\\", "Seat", "\\", "Web", "\\", "Http", "\\", "Validation", "\\", "StandingsElementAdd", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Tools/StandingsController.php#L199-L222
eveseat/web
src/Http/Controllers/Tools/StandingsController.php
StandingsController.postAddStandingsFromCorpOrChar
public function postAddStandingsFromCorpOrChar(StandingsExistingElementAdd $request) { // Get the standings profile that will be updated. $standings_profile = StandingsProfile::find($request->input('id')); // Character Contacts if ($request->filled('character')) { forea...
php
public function postAddStandingsFromCorpOrChar(StandingsExistingElementAdd $request) { // Get the standings profile that will be updated. $standings_profile = StandingsProfile::find($request->input('id')); // Character Contacts if ($request->filled('character')) { forea...
[ "public", "function", "postAddStandingsFromCorpOrChar", "(", "StandingsExistingElementAdd", "$", "request", ")", "{", "// Get the standings profile that will be updated.", "$", "standings_profile", "=", "StandingsProfile", "::", "find", "(", "$", "request", "->", "input", "...
@param \Seat\Web\Http\Validation\StandingsExistingElementAdd $request @return \Illuminate\Http\RedirectResponse
[ "@param", "\\", "Seat", "\\", "Web", "\\", "Http", "\\", "Validation", "\\", "StandingsExistingElementAdd", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Tools/StandingsController.php#L229-L280
eveseat/web
src/Http/Controllers/Tools/StandingsController.php
StandingsController.getRemoveElementFromProfile
public function getRemoveElementFromProfile(int $element_id, int $profile_id) { // Get the standings profile that will be updated. $standings_profile = StandingsProfile::find($profile_id); $standings_profile->standings()->find($element_id)->delete(); return redirect()->back() ...
php
public function getRemoveElementFromProfile(int $element_id, int $profile_id) { // Get the standings profile that will be updated. $standings_profile = StandingsProfile::find($profile_id); $standings_profile->standings()->find($element_id)->delete(); return redirect()->back() ...
[ "public", "function", "getRemoveElementFromProfile", "(", "int", "$", "element_id", ",", "int", "$", "profile_id", ")", "{", "// Get the standings profile that will be updated.", "$", "standings_profile", "=", "StandingsProfile", "::", "find", "(", "$", "profile_id", ")...
@param int $element_id @param int $profile_id @return \Illuminate\Http\RedirectResponse
[ "@param", "int", "$element_id", "@param", "int", "$profile_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Tools/StandingsController.php#L288-L298
eveseat/web
src/Acl/AccessChecker.php
AccessChecker.hasAny
public function hasAny(array $permissions, bool $need_affiliation = true): bool { foreach ($permissions as $permission) if ($this->has($permission, $need_affiliation)) return true; return false; }
php
public function hasAny(array $permissions, bool $need_affiliation = true): bool { foreach ($permissions as $permission) if ($this->has($permission, $need_affiliation)) return true; return false; }
[ "public", "function", "hasAny", "(", "array", "$", "permissions", ",", "bool", "$", "need_affiliation", "=", "true", ")", ":", "bool", "{", "foreach", "(", "$", "permissions", "as", "$", "permission", ")", "if", "(", "$", "this", "->", "has", "(", "$",...
Checks if the user has any of the required permissions. @param array $permissions @param bool|false $need_affiliation @return bool @throws \Seat\Web\Exceptions\BouncerException
[ "Checks", "if", "the", "user", "has", "any", "of", "the", "required", "permissions", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessChecker.php#L50-L58
eveseat/web
src/Acl/AccessChecker.php
AccessChecker.has
public function has($permission, $need_affiliation = true) { if ($this->hasSuperUser()) return true; if (! $need_affiliation) { if ($this->hasPermissions($permission)) return true; } else { if ($this->hasAffiliationAndPermission($permi...
php
public function has($permission, $need_affiliation = true) { if ($this->hasSuperUser()) return true; if (! $need_affiliation) { if ($this->hasPermissions($permission)) return true; } else { if ($this->hasAffiliationAndPermission($permi...
[ "public", "function", "has", "(", "$", "permission", ",", "$", "need_affiliation", "=", "true", ")", "{", "if", "(", "$", "this", "->", "hasSuperUser", "(", ")", ")", "return", "true", ";", "if", "(", "!", "$", "need_affiliation", ")", "{", "if", "("...
Has. This is probably *the* most important function in the ACL logic. It's sole purpose is to ensure that a logged in user has a specific permission. @param $permission @param bool $need_affiliation @return bool @throws \Seat\Web\Exceptions\BouncerException
[ "Has", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessChecker.php#L73-L93
eveseat/web
src/Acl/AccessChecker.php
AccessChecker.hasSuperUser
public function hasSuperUser() { $permissions = $this->getAllPermissions(); foreach ($permissions as $permission) if ($permission === 'superuser') return true; return false; }
php
public function hasSuperUser() { $permissions = $this->getAllPermissions(); foreach ($permissions as $permission) if ($permission === 'superuser') return true; return false; }
[ "public", "function", "hasSuperUser", "(", ")", "{", "$", "permissions", "=", "$", "this", "->", "getAllPermissions", "(", ")", ";", "foreach", "(", "$", "permissions", "as", "$", "permission", ")", "if", "(", "$", "permission", "===", "'superuser'", ")", ...
Determine of the current user has the superuser permission.
[ "Determine", "of", "the", "current", "user", "has", "the", "superuser", "permission", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessChecker.php#L99-L108
eveseat/web
src/Acl/AccessChecker.php
AccessChecker.getAllPermissions
public function getAllPermissions() { $permissions = []; $roles = $this->group->roles()->with('permissions')->get(); // Go through every role... foreach ($roles as $role) { // ... in every defined permission foreach ($role->permissions as $permission) { ...
php
public function getAllPermissions() { $permissions = []; $roles = $this->group->roles()->with('permissions')->get(); // Go through every role... foreach ($roles as $role) { // ... in every defined permission foreach ($role->permissions as $permission) { ...
[ "public", "function", "getAllPermissions", "(", ")", "{", "$", "permissions", "=", "[", "]", ";", "$", "roles", "=", "$", "this", "->", "group", "->", "roles", "(", ")", "->", "with", "(", "'permissions'", ")", "->", "get", "(", ")", ";", "// Go thro...
Return an array of all the of the permissions that the user has. @return array
[ "Return", "an", "array", "of", "all", "the", "of", "the", "permissions", "that", "the", "user", "has", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessChecker.php#L116-L137
eveseat/web
src/Acl/AccessChecker.php
AccessChecker.hasAffiliationAndPermission
public function hasAffiliationAndPermission($permission) { // TODO: An annoying change in the 3x migration introduced // and array based permission, which is stupid. Remove that // or plan better for it in 3.1 $array_permission = $permission; if (! is_array($permission)) ...
php
public function hasAffiliationAndPermission($permission) { // TODO: An annoying change in the 3x migration introduced // and array based permission, which is stupid. Remove that // or plan better for it in 3.1 $array_permission = $permission; if (! is_array($permission)) ...
[ "public", "function", "hasAffiliationAndPermission", "(", "$", "permission", ")", "{", "// TODO: An annoying change in the 3x migration introduced", "// and array based permission, which is stupid. Remove that", "// or plan better for it in 3.1", "$", "array_permission", "=", "$", "per...
Check if the user is correctly affiliated *and* has the requested permission on that affiliation. @param $permission @return bool @throws \Seat\Web\Exceptions\BouncerException
[ "Check", "if", "the", "user", "is", "correctly", "affiliated", "*", "and", "*", "has", "the", "requested", "permission", "on", "that", "affiliation", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessChecker.php#L165-L186
eveseat/web
src/Acl/AccessChecker.php
AccessChecker.hasCharacterPermission
private function hasCharacterPermission(array $permission) { $map = $this->getAffiliationMap(); // Owning a character grants you '*' permissions to the owned object. In this // context, '*' acts as a wildcard for *all* permissions foreach ($map['char'] as $char => $permissions) { ...
php
private function hasCharacterPermission(array $permission) { $map = $this->getAffiliationMap(); // Owning a character grants you '*' permissions to the owned object. In this // context, '*' acts as a wildcard for *all* permissions foreach ($map['char'] as $char => $permissions) { ...
[ "private", "function", "hasCharacterPermission", "(", "array", "$", "permission", ")", "{", "$", "map", "=", "$", "this", "->", "getAffiliationMap", "(", ")", ";", "// Owning a character grants you '*' permissions to the owned object. In this", "// context, '*' acts as a wild...
@param array $permission @return bool @throws \Seat\Web\Exceptions\BouncerException
[ "@param", "array", "$permission" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessChecker.php#L194-L223
eveseat/web
src/Acl/AccessChecker.php
AccessChecker.getAffiliationMap
public function getAffiliationMap() { // Prepare a skeleton of the final affiliation map that // will be returned. $map = [ 'char' => [], 'corp' => [], // These keys keep record of the affiliations and // per...
php
public function getAffiliationMap() { // Prepare a skeleton of the final affiliation map that // will be returned. $map = [ 'char' => [], 'corp' => [], // These keys keep record of the affiliations and // per...
[ "public", "function", "getAffiliationMap", "(", ")", "{", "// Prepare a skeleton of the final affiliation map that", "// will be returned.", "$", "map", "=", "[", "'char'", "=>", "[", "]", ",", "'corp'", "=>", "[", "]", ",", "// These keys keep record of the affiliations ...
The affiliation map maps character / corporation ID's to the permissions that they have. This allows us to simply lookup the existence of a permission in the context of an ID. All roles are considered but strict adherence to *which* affiliation ID's are applicable is kept. Keys that a character own automatically grant...
[ "The", "affiliation", "map", "maps", "character", "/", "corporation", "ID", "s", "to", "the", "permissions", "that", "they", "have", ".", "This", "allows", "us", "to", "simply", "lookup", "the", "existence", "of", "a", "permission", "in", "the", "context", ...
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessChecker.php#L239-L469
eveseat/web
src/Acl/AccessChecker.php
AccessChecker.hasCorporationPermission
private function hasCorporationPermission(array $permission) { $map = $this->getAffiliationMap(); foreach ($map['corp'] as $corp => $permissions) { // in case the permissions array is not related to the corporation for which we're checking access // skip if ($c...
php
private function hasCorporationPermission(array $permission) { $map = $this->getAffiliationMap(); foreach ($map['corp'] as $corp => $permissions) { // in case the permissions array is not related to the corporation for which we're checking access // skip if ($c...
[ "private", "function", "hasCorporationPermission", "(", "array", "$", "permission", ")", "{", "$", "map", "=", "$", "this", "->", "getAffiliationMap", "(", ")", ";", "foreach", "(", "$", "map", "[", "'corp'", "]", "as", "$", "corp", "=>", "$", "permissio...
@param array $permission @return bool @throws \Seat\Web\Exceptions\BouncerException
[ "@param", "array", "$permission" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessChecker.php#L493-L517
eveseat/web
src/Acl/AccessChecker.php
AccessChecker.hasRole
public function hasRole($role_name) { if ($this->hasSuperUser()) return true; foreach ($this->group->roles as $role) if ($role->title == $role_name) return true; return false; }
php
public function hasRole($role_name) { if ($this->hasSuperUser()) return true; foreach ($this->group->roles as $role) if ($role->title == $role_name) return true; return false; }
[ "public", "function", "hasRole", "(", "$", "role_name", ")", "{", "if", "(", "$", "this", "->", "hasSuperUser", "(", ")", ")", "return", "true", ";", "foreach", "(", "$", "this", "->", "group", "->", "roles", "as", "$", "role", ")", "if", "(", "$",...
Determine if the current user has a specific role. @param $role_name @return bool
[ "Determine", "if", "the", "current", "user", "has", "a", "specific", "role", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessChecker.php#L543-L555
eveseat/web
src/Http/Controllers/Configuration/AccessController.php
AccessController.newRole
public function newRole(Role $request) { $role = $this->addRole($request->input('title')); return redirect() ->route('configuration.access.roles.edit', ['id' => $role->id]) ->with('success', trans('web::seat.role_added')); }
php
public function newRole(Role $request) { $role = $this->addRole($request->input('title')); return redirect() ->route('configuration.access.roles.edit', ['id' => $role->id]) ->with('success', trans('web::seat.role_added')); }
[ "public", "function", "newRole", "(", "Role", "$", "request", ")", "{", "$", "role", "=", "$", "this", "->", "addRole", "(", "$", "request", "->", "input", "(", "'title'", ")", ")", ";", "return", "redirect", "(", ")", "->", "route", "(", "'configura...
@param \Seat\Web\Http\Validation\Role $request @return mixed
[ "@param", "\\", "Seat", "\\", "Web", "\\", "Http", "\\", "Validation", "\\", "Role", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/AccessController.php#L59-L67
eveseat/web
src/Http/Controllers/Configuration/AccessController.php
AccessController.editRole
public function editRole($role_id) { // Get the role. We don't get the full one // as we need to mangle some of the data to // arrays for easier processing in the view $role = $this->getRole($role_id); $role_permissions = $role->permissions()->get()->pluck('title')->toArray...
php
public function editRole($role_id) { // Get the role. We don't get the full one // as we need to mangle some of the data to // arrays for easier processing in the view $role = $this->getRole($role_id); $role_permissions = $role->permissions()->get()->pluck('title')->toArray...
[ "public", "function", "editRole", "(", "$", "role_id", ")", "{", "// Get the role. We don't get the full one", "// as we need to mangle some of the data to", "// arrays for easier processing in the view", "$", "role", "=", "$", "this", "->", "getRole", "(", "$", "role_id", ...
@param $role_id @return \Illuminate\View\View
[ "@param", "$role_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/AccessController.php#L88-L109
eveseat/web
src/Http/Controllers/Configuration/AccessController.php
AccessController.grantPermissions
public function grantPermissions(RolePermission $request) { $this->giveRolePermissions( $request->input('role_id'), $request->input('permissions'), $request->input('inverse') ? true : false); return redirect()->back() ->with('success', trans('web::se...
php
public function grantPermissions(RolePermission $request) { $this->giveRolePermissions( $request->input('role_id'), $request->input('permissions'), $request->input('inverse') ? true : false); return redirect()->back() ->with('success', trans('web::se...
[ "public", "function", "grantPermissions", "(", "RolePermission", "$", "request", ")", "{", "$", "this", "->", "giveRolePermissions", "(", "$", "request", "->", "input", "(", "'role_id'", ")", ",", "$", "request", "->", "input", "(", "'permissions'", ")", ","...
@param \Seat\Web\Http\Validation\RolePermission $request @return mixed
[ "@param", "\\", "Seat", "\\", "Web", "\\", "Http", "\\", "Validation", "\\", "RolePermission", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/AccessController.php#L116-L126
eveseat/web
src/Http/Controllers/Configuration/AccessController.php
AccessController.removePermissions
public function removePermissions($role_id, $permission_id) { $this->removePermissionFromRole($permission_id, $role_id); return redirect()->back() ->with('success', trans('web::seat.permission_revoked')); }
php
public function removePermissions($role_id, $permission_id) { $this->removePermissionFromRole($permission_id, $role_id); return redirect()->back() ->with('success', trans('web::seat.permission_revoked')); }
[ "public", "function", "removePermissions", "(", "$", "role_id", ",", "$", "permission_id", ")", "{", "$", "this", "->", "removePermissionFromRole", "(", "$", "permission_id", ",", "$", "role_id", ")", ";", "return", "redirect", "(", ")", "->", "back", "(", ...
@param $role_id @param $permission_id @return mixed
[ "@param", "$role_id", "@param", "$permission_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/AccessController.php#L134-L141
eveseat/web
src/Http/Controllers/Configuration/AccessController.php
AccessController.addGroups
public function addGroups(RoleGroup $request) { $this->giveGroupsRole( $request->input('groups'), $request->input('role_id')); return redirect()->back() ->with('success', trans('web::seat.user_added')); }
php
public function addGroups(RoleGroup $request) { $this->giveGroupsRole( $request->input('groups'), $request->input('role_id')); return redirect()->back() ->with('success', trans('web::seat.user_added')); }
[ "public", "function", "addGroups", "(", "RoleGroup", "$", "request", ")", "{", "$", "this", "->", "giveGroupsRole", "(", "$", "request", "->", "input", "(", "'groups'", ")", ",", "$", "request", "->", "input", "(", "'role_id'", ")", ")", ";", "return", ...
@param \Seat\Web\Http\Validation\RoleGroup $request @return mixed
[ "@param", "\\", "Seat", "\\", "Web", "\\", "Http", "\\", "Validation", "\\", "RoleGroup", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/AccessController.php#L148-L157
eveseat/web
src/Http/Controllers/Configuration/AccessController.php
AccessController.removeGroup
public function removeGroup($role_id, $group_id) { $this->removeGroupFromRole($group_id, $role_id); return redirect()->back() ->with('success', trans('web::seat.user_removed')); }
php
public function removeGroup($role_id, $group_id) { $this->removeGroupFromRole($group_id, $role_id); return redirect()->back() ->with('success', trans('web::seat.user_removed')); }
[ "public", "function", "removeGroup", "(", "$", "role_id", ",", "$", "group_id", ")", "{", "$", "this", "->", "removeGroupFromRole", "(", "$", "group_id", ",", "$", "role_id", ")", ";", "return", "redirect", "(", ")", "->", "back", "(", ")", "->", "with...
@param $role_id @param $group_id @return mixed
[ "@param", "$role_id", "@param", "$group_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/AccessController.php#L165-L172
eveseat/web
src/Http/Controllers/Configuration/AccessController.php
AccessController.addAffiliations
public function addAffiliations(RoleAffilliation $request) { if ($request->input('corporations')) $this->giveRoleCorporationAffiliations( $request->input('role_id'), $request->input('corporations'), $request->input('inverse') ? true : false); ...
php
public function addAffiliations(RoleAffilliation $request) { if ($request->input('corporations')) $this->giveRoleCorporationAffiliations( $request->input('role_id'), $request->input('corporations'), $request->input('inverse') ? true : false); ...
[ "public", "function", "addAffiliations", "(", "RoleAffilliation", "$", "request", ")", "{", "if", "(", "$", "request", "->", "input", "(", "'corporations'", ")", ")", "$", "this", "->", "giveRoleCorporationAffiliations", "(", "$", "request", "->", "input", "("...
@param \Seat\Web\Http\Validation\RoleAffilliation $request @return mixed
[ "@param", "\\", "Seat", "\\", "Web", "\\", "Http", "\\", "Validation", "\\", "RoleAffilliation", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/AccessController.php#L179-L196
eveseat/web
src/Http/Controllers/Configuration/AccessController.php
AccessController.removeAffiliation
public function removeAffiliation($role_id, $affiliation_id) { $this->removeAffiliationFromRole($role_id, $affiliation_id); return redirect()->back() ->with('success', trans('web::seat.affiliation_removed')); }
php
public function removeAffiliation($role_id, $affiliation_id) { $this->removeAffiliationFromRole($role_id, $affiliation_id); return redirect()->back() ->with('success', trans('web::seat.affiliation_removed')); }
[ "public", "function", "removeAffiliation", "(", "$", "role_id", ",", "$", "affiliation_id", ")", "{", "$", "this", "->", "removeAffiliationFromRole", "(", "$", "role_id", ",", "$", "affiliation_id", ")", ";", "return", "redirect", "(", ")", "->", "back", "("...
@param $role_id @param $affiliation_id @return mixed
[ "@param", "$role_id", "@param", "$affiliation_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/AccessController.php#L204-L211
eveseat/web
src/Http/Controllers/Character/FittingController.php
FittingController.getFittingItems
public function getFittingItems(int $character_id, int $fitting_id) { $fitting = $this->getCharacterFitting($character_id, $fitting_id); $items = $this->getCharacterFittingItems($fitting_id); return view('web::character.fittingitems', compact('fitting', 'items')); }
php
public function getFittingItems(int $character_id, int $fitting_id) { $fitting = $this->getCharacterFitting($character_id, $fitting_id); $items = $this->getCharacterFittingItems($fitting_id); return view('web::character.fittingitems', compact('fitting', 'items')); }
[ "public", "function", "getFittingItems", "(", "int", "$", "character_id", ",", "int", "$", "fitting_id", ")", "{", "$", "fitting", "=", "$", "this", "->", "getCharacterFitting", "(", "$", "character_id", ",", "$", "fitting_id", ")", ";", "$", "items", "=",...
@param int $character_id @param int $fitting_id @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
[ "@param", "int", "$character_id", "@param", "int", "$fitting_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Character/FittingController.php#L56-L63
eveseat/web
src/Http/Composers/CorporationLayout.php
CorporationLayout.compose
public function compose(View $view) { $corporation_info = CorporationInfo::find($this->request->corporation_id); if (! is_null($corporation_info)) $view->with('corporation_name', $corporation_info->name); }
php
public function compose(View $view) { $corporation_info = CorporationInfo::find($this->request->corporation_id); if (! is_null($corporation_info)) $view->with('corporation_name', $corporation_info->name); }
[ "public", "function", "compose", "(", "View", "$", "view", ")", "{", "$", "corporation_info", "=", "CorporationInfo", "::", "find", "(", "$", "this", "->", "request", "->", "corporation_id", ")", ";", "if", "(", "!", "is_null", "(", "$", "corporation_info"...
Bind Character Name to the view. @param View $view
[ "Bind", "Character", "Name", "to", "the", "view", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Composers/CorporationLayout.php#L48-L54
eveseat/web
src/Http/Controllers/Corporation/MarketController.php
MarketController.getMarketData
public function getMarketData(int $corporation_id) { $orders = $this->getCorporationMarketOrders($corporation_id, false); return DataTables::of($orders) ->addColumn('bs', function ($row) { return view('web::partials.marketbuysell', compact('row')); }) ...
php
public function getMarketData(int $corporation_id) { $orders = $this->getCorporationMarketOrders($corporation_id, false); return DataTables::of($orders) ->addColumn('bs', function ($row) { return view('web::partials.marketbuysell', compact('row')); }) ...
[ "public", "function", "getMarketData", "(", "int", "$", "corporation_id", ")", "{", "$", "orders", "=", "$", "this", "->", "getCorporationMarketOrders", "(", "$", "corporation_id", ",", "false", ")", ";", "return", "DataTables", "::", "of", "(", "$", "orders...
@param int $corporation_id @return mixed @throws \Exception
[ "@param", "int", "$corporation_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Corporation/MarketController.php#L58-L112
eveseat/web
src/Http/Middleware/Requirements.php
Requirements.handle
public function handle($request, Closure $next) { // Get the status of all of the extensions $requirements = collect(array_map(function ($extension) { return [ 'name' => $extension, 'loaded' => extension_loaded($extension), ]; }, s...
php
public function handle($request, Closure $next) { // Get the status of all of the extensions $requirements = collect(array_map(function ($extension) { return [ 'name' => $extension, 'loaded' => extension_loaded($extension), ]; }, s...
[ "public", "function", "handle", "(", "$", "request", ",", "Closure", "$", "next", ")", "{", "// Get the status of all of the extensions", "$", "requirements", "=", "collect", "(", "array_map", "(", "function", "(", "$", "extension", ")", "{", "return", "[", "'...
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @return mixed
[ "Handle", "an", "incoming", "request", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Middleware/Requirements.php#L50-L79
eveseat/web
src/Http/Validation/ProfileSettings.php
ProfileSettings.rules
public function rules() { $allowed_main_character_ids = auth()->user()->associatedCharacterIds()->implode(','); $allowed_skins = implode(',', Profile::$options['skins']); $allowed_languages = implode(',', array_map(function ($entry) { return $entry['short']; }, config('...
php
public function rules() { $allowed_main_character_ids = auth()->user()->associatedCharacterIds()->implode(','); $allowed_skins = implode(',', Profile::$options['skins']); $allowed_languages = implode(',', array_map(function ($entry) { return $entry['short']; }, config('...
[ "public", "function", "rules", "(", ")", "{", "$", "allowed_main_character_ids", "=", "auth", "(", ")", "->", "user", "(", ")", "->", "associatedCharacterIds", "(", ")", "->", "implode", "(", "','", ")", ";", "$", "allowed_skins", "=", "implode", "(", "'...
Get the validation rules that apply to the request. @return array
[ "Get", "the", "validation", "rules", "that", "apply", "to", "the", "request", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Validation/ProfileSettings.php#L46-L74
eveseat/web
src/Http/Middleware/Bouncer/KeyBouncer.php
KeyBouncer.handle
public function handle(Request $request, Closure $next, string $permission = null) { // Get the currently logged in user $user = auth()->user(); // Having the permission / superuser here means // your access is fine. if ($user->has('apikey.' . $permission, false)) ...
php
public function handle(Request $request, Closure $next, string $permission = null) { // Get the currently logged in user $user = auth()->user(); // Having the permission / superuser here means // your access is fine. if ($user->has('apikey.' . $permission, false)) ...
[ "public", "function", "handle", "(", "Request", "$", "request", ",", "Closure", "$", "next", ",", "string", "$", "permission", "=", "null", ")", "{", "// Get the currently logged in user", "$", "user", "=", "auth", "(", ")", "->", "user", "(", ")", ";", ...
Handle an incoming request. This filter checks the required permissions or key ownership for a API key. @param \Illuminate\Http\Request $request @param \Closure $next @param string $permission @return \Illuminate\Http\RedirectResponse
[ "Handle", "an", "incoming", "request", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Middleware/Bouncer/KeyBouncer.php#L46-L71
eveseat/web
src/Http/Controllers/Corporation/CorporationsController.php
CorporationsController.deleteCorporation
public function deleteCorporation(int $corporation_id) { CorporationInfo::find($corporation_id)->delete(); return redirect()->back()->with( 'success', 'Corporation deleted!' ); }
php
public function deleteCorporation(int $corporation_id) { CorporationInfo::find($corporation_id)->delete(); return redirect()->back()->with( 'success', 'Corporation deleted!' ); }
[ "public", "function", "deleteCorporation", "(", "int", "$", "corporation_id", ")", "{", "CorporationInfo", "::", "find", "(", "$", "corporation_id", ")", "->", "delete", "(", ")", ";", "return", "redirect", "(", ")", "->", "back", "(", ")", "->", "with", ...
@param int $corporation_id @return \Illuminate\Http\RedirectResponse
[ "@param", "int", "$corporation_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Corporation/CorporationsController.php#L92-L100
eveseat/web
src/Http/Controllers/Character/AssetsController.php
AssetsController.getCharacterAssets
public function getCharacterAssets(int $character_id) { if (! request()->has('all_linked_characters')) return abort(500); if (request('all_linked_characters') === 'false') $character_ids = collect($character_id); if (request('all_linked_characters') === 'true') ...
php
public function getCharacterAssets(int $character_id) { if (! request()->has('all_linked_characters')) return abort(500); if (request('all_linked_characters') === 'false') $character_ids = collect($character_id); if (request('all_linked_characters') === 'true') ...
[ "public", "function", "getCharacterAssets", "(", "int", "$", "character_id", ")", "{", "if", "(", "!", "request", "(", ")", "->", "has", "(", "'all_linked_characters'", ")", ")", "return", "abort", "(", "500", ")", ";", "if", "(", "request", "(", "'all_l...
@param int $character_id @return mixed @throws \Exception
[ "@param", "int", "$character_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Character/AssetsController.php#L55-L97
eveseat/web
src/Http/Validation/RolePermission.php
RolePermission.rules
public function rules() { // Start with a default rules array for the // role_id check $rules = [ 'role_id' => 'required|exists:roles,id', 'inverse' => 'nullable|in:on', ]; // Ensure that the permissions is set, if not, // complain that it is...
php
public function rules() { // Start with a default rules array for the // role_id check $rules = [ 'role_id' => 'required|exists:roles,id', 'inverse' => 'nullable|in:on', ]; // Ensure that the permissions is set, if not, // complain that it is...
[ "public", "function", "rules", "(", ")", "{", "// Start with a default rules array for the", "// role_id check", "$", "rules", "=", "[", "'role_id'", "=>", "'required|exists:roles,id'", ",", "'inverse'", "=>", "'nullable|in:on'", ",", "]", ";", "// Ensure that the permiss...
Get the validation rules that apply to the request. @return array
[ "Get", "the", "validation", "rules", "that", "apply", "to", "the", "request", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Validation/RolePermission.php#L49-L111
eveseat/web
src/Acl/AccessManager.php
AccessManager.getCompleteRole
public function getCompleteRole(int $role_id = null) { $roles = RoleModel::with('permissions', 'groups', 'affiliations'); if (! is_null($role_id)) { $roles = $roles->where('id', $role_id)->first(); if (! $roles) abort(404); return $roles; } r...
php
public function getCompleteRole(int $role_id = null) { $roles = RoleModel::with('permissions', 'groups', 'affiliations'); if (! is_null($role_id)) { $roles = $roles->where('id', $role_id)->first(); if (! $roles) abort(404); return $roles; } r...
[ "public", "function", "getCompleteRole", "(", "int", "$", "role_id", "=", "null", ")", "{", "$", "roles", "=", "RoleModel", "::", "with", "(", "'permissions'", ",", "'groups'", ",", "'affiliations'", ")", ";", "if", "(", "!", "is_null", "(", "$", "role_i...
Return everything related to the Role with eager loading. @param int $role_id @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Collection
[ "Return", "everything", "related", "to", "the", "Role", "with", "eager", "loading", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessManager.php#L46-L61
eveseat/web
src/Acl/AccessManager.php
AccessManager.removeRoleByTitle
public function removeRoleByTitle(string $title) { $role = RoleModel::where('title', $title)->first(); $this->removeRole($role->id); }
php
public function removeRoleByTitle(string $title) { $role = RoleModel::where('title', $title)->first(); $this->removeRole($role->id); }
[ "public", "function", "removeRoleByTitle", "(", "string", "$", "title", ")", "{", "$", "role", "=", "RoleModel", "::", "where", "(", "'title'", ",", "$", "title", ")", "->", "first", "(", ")", ";", "$", "this", "->", "removeRole", "(", "$", "role", "...
Remove a role by title. @param string $title
[ "Remove", "a", "role", "by", "title", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessManager.php#L84-L89
eveseat/web
src/Acl/AccessManager.php
AccessManager.giveRolePermissions
public function giveRolePermissions($role_id, array $permissions, bool $inverse) { foreach ($permissions as $key => $permission_name) $this->giveRolePermission($role_id, $permission_name, $inverse); }
php
public function giveRolePermissions($role_id, array $permissions, bool $inverse) { foreach ($permissions as $key => $permission_name) $this->giveRolePermission($role_id, $permission_name, $inverse); }
[ "public", "function", "giveRolePermissions", "(", "$", "role_id", ",", "array", "$", "permissions", ",", "bool", "$", "inverse", ")", "{", "foreach", "(", "$", "permissions", "as", "$", "key", "=>", "$", "permission_name", ")", "$", "this", "->", "giveRole...
Give a role many permissions. @param $role_id @param array $permissions @param bool $inverse
[ "Give", "a", "role", "many", "permissions", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessManager.php#L111-L117
eveseat/web
src/Acl/AccessManager.php
AccessManager.giveRolePermission
public function giveRolePermission(int $role_id, string $permission_name, bool $inverse) { $role = $this->getRole($role_id); $permission = PermissionModel::firstOrNew([ 'title' => $permission_name, ]); // If the role does not already have the permission // add ...
php
public function giveRolePermission(int $role_id, string $permission_name, bool $inverse) { $role = $this->getRole($role_id); $permission = PermissionModel::firstOrNew([ 'title' => $permission_name, ]); // If the role does not already have the permission // add ...
[ "public", "function", "giveRolePermission", "(", "int", "$", "role_id", ",", "string", "$", "permission_name", ",", "bool", "$", "inverse", ")", "{", "$", "role", "=", "$", "this", "->", "getRole", "(", "$", "role_id", ")", ";", "$", "permission", "=", ...
Give a Role a permission. @param int $role_id @param string $permission_name @param bool $inverse
[ "Give", "a", "Role", "a", "permission", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessManager.php#L126-L141
eveseat/web
src/Acl/AccessManager.php
AccessManager.removePermissionFromRole
public function removePermissionFromRole(int $permission_id, int $role_id) { $role = $this->getRole($role_id); $role->permissions()->detach($permission_id); }
php
public function removePermissionFromRole(int $permission_id, int $role_id) { $role = $this->getRole($role_id); $role->permissions()->detach($permission_id); }
[ "public", "function", "removePermissionFromRole", "(", "int", "$", "permission_id", ",", "int", "$", "role_id", ")", "{", "$", "role", "=", "$", "this", "->", "getRole", "(", "$", "role_id", ")", ";", "$", "role", "->", "permissions", "(", ")", "->", "...
Remove a permission from a Role. @param int $permission_id @param int $role_id
[ "Remove", "a", "permission", "from", "a", "Role", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessManager.php#L162-L168
eveseat/web
src/Acl/AccessManager.php
AccessManager.giveGroupsRole
public function giveGroupsRole(array $group_ids, int $role_id) { foreach ($group_ids as $group_id) { $group = Group::where('id', $group_id)->first(); $this->giveGroupRole($group->id, $role_id); } }
php
public function giveGroupsRole(array $group_ids, int $role_id) { foreach ($group_ids as $group_id) { $group = Group::where('id', $group_id)->first(); $this->giveGroupRole($group->id, $role_id); } }
[ "public", "function", "giveGroupsRole", "(", "array", "$", "group_ids", ",", "int", "$", "role_id", ")", "{", "foreach", "(", "$", "group_ids", "as", "$", "group_id", ")", "{", "$", "group", "=", "Group", "::", "where", "(", "'id'", ",", "$", "group_id...
Give an array of group_ids a role. @param array $group_ids @param int $role_id
[ "Give", "an", "array", "of", "group_ids", "a", "role", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessManager.php#L176-L184
eveseat/web
src/Acl/AccessManager.php
AccessManager.giveGroupRole
public function giveGroupRole(int $group_id, int $role_id) { $group = Group::find($group_id); $role = RoleModel::firstOrNew(['id' => $role_id]); // If the role does not already have the group add it. if (! $role->groups->contains($group_id)) { $role->groups()->save($gro...
php
public function giveGroupRole(int $group_id, int $role_id) { $group = Group::find($group_id); $role = RoleModel::firstOrNew(['id' => $role_id]); // If the role does not already have the group add it. if (! $role->groups->contains($group_id)) { $role->groups()->save($gro...
[ "public", "function", "giveGroupRole", "(", "int", "$", "group_id", ",", "int", "$", "role_id", ")", "{", "$", "group", "=", "Group", "::", "find", "(", "$", "group_id", ")", ";", "$", "role", "=", "RoleModel", "::", "firstOrNew", "(", "[", "'id'", "...
Give a group a Role. @param int $group_id @param int $role_id
[ "Give", "a", "group", "a", "Role", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessManager.php#L192-L203
eveseat/web
src/Acl/AccessManager.php
AccessManager.removeGroupFromRole
public function removeGroupFromRole(int $group_id, int $role_id) { $role = $this->getRole($role_id); if ($role->groups()->detach($group_id) > 0) event(new UserGroupRoleRemoved($group_id, $role)); }
php
public function removeGroupFromRole(int $group_id, int $role_id) { $role = $this->getRole($role_id); if ($role->groups()->detach($group_id) > 0) event(new UserGroupRoleRemoved($group_id, $role)); }
[ "public", "function", "removeGroupFromRole", "(", "int", "$", "group_id", ",", "int", "$", "role_id", ")", "{", "$", "role", "=", "$", "this", "->", "getRole", "(", "$", "role_id", ")", ";", "if", "(", "$", "role", "->", "groups", "(", ")", "->", "...
Remove a group from a role. @param int $group_id @param int $role_id
[ "Remove", "a", "group", "from", "a", "role", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Acl/AccessManager.php#L211-L218
eveseat/web
src/Http/Controllers/Character/MiningLedgerController.php
MiningLedgerController.getDetailedLedger
public function getDetailedLedger(int $character_id, $date, int $system_id, int $type_id): JsonResponse { if (! request()->has('all_linked_characters')) return abort(500); $character_ids = collect($character_id); $entries = $this->getCharacterLedger($character_ids) ...
php
public function getDetailedLedger(int $character_id, $date, int $system_id, int $type_id): JsonResponse { if (! request()->has('all_linked_characters')) return abort(500); $character_ids = collect($character_id); $entries = $this->getCharacterLedger($character_ids) ...
[ "public", "function", "getDetailedLedger", "(", "int", "$", "character_id", ",", "$", "date", ",", "int", "$", "system_id", ",", "int", "$", "type_id", ")", ":", "JsonResponse", "{", "if", "(", "!", "request", "(", ")", "->", "has", "(", "'all_linked_cha...
@param int $character_id @param $date @param int $system_id @param int $type_id @return \Illuminate\Http\JsonResponse @throws \Exception
[ "@param", "int", "$character_id", "@param", "$date", "@param", "int", "$system_id", "@param", "int", "$type_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Character/MiningLedgerController.php#L115-L155
eveseat/web
src/Models/Acl/Role.php
Role.delete
public function delete() { // Remove the Role from users, permissions // and affiliations that it had $this->groups()->detach(); $this->permissions()->detach(); $this->affiliations()->detach(); return parent::delete(); }
php
public function delete() { // Remove the Role from users, permissions // and affiliations that it had $this->groups()->detach(); $this->permissions()->detach(); $this->affiliations()->detach(); return parent::delete(); }
[ "public", "function", "delete", "(", ")", "{", "// Remove the Role from users, permissions", "// and affiliations that it had", "$", "this", "->", "groups", "(", ")", "->", "detach", "(", ")", ";", "$", "this", "->", "permissions", "(", ")", "->", "detach", "(",...
Make sure we cleanup on delete. @return bool|null @throws \Exception
[ "Make", "sure", "we", "cleanup", "on", "delete", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Models/Acl/Role.php#L50-L60
eveseat/web
src/Http/Controllers/Character/MarketController.php
MarketController.getMarketData
public function getMarketData(int $character_id) { if (! request()->has('all_linked_characters')) return abort(500); if (request('all_linked_characters') === 'false') $character_ids = collect($character_id); $user_group = User::find($character_id)->group->users ...
php
public function getMarketData(int $character_id) { if (! request()->has('all_linked_characters')) return abort(500); if (request('all_linked_characters') === 'false') $character_ids = collect($character_id); $user_group = User::find($character_id)->group->users ...
[ "public", "function", "getMarketData", "(", "int", "$", "character_id", ")", "{", "if", "(", "!", "request", "(", ")", "->", "has", "(", "'all_linked_characters'", ")", ")", "return", "abort", "(", "500", ")", ";", "if", "(", "request", "(", "'all_linked...
@param int $character_id @return mixed @throws \Exception
[ "@param", "int", "$character_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Character/MarketController.php#L58-L105
eveseat/web
src/Http/Composers/CharacterMenu.php
CharacterMenu.compose
public function compose(View $view) { // This menu item declares the menu and // sets it as an array of arrays. $menu = []; // Load any package menus if (! empty(config('package.character.menu'))) { foreach (config('package.character.menu') as $menu_data) { ...
php
public function compose(View $view) { // This menu item declares the menu and // sets it as an array of arrays. $menu = []; // Load any package menus if (! empty(config('package.character.menu'))) { foreach (config('package.character.menu') as $menu_data) { ...
[ "public", "function", "compose", "(", "View", "$", "view", ")", "{", "// This menu item declares the menu and", "// sets it as an array of arrays.", "$", "menu", "=", "[", "]", ";", "// Load any package menus", "if", "(", "!", "empty", "(", "config", "(", "'package....
Bind data to the view. @param View $view @return void @throws \Seat\Web\Exceptions\PackageMenuBuilderException
[ "Bind", "data", "to", "the", "view", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Composers/CharacterMenu.php#L62-L89
eveseat/web
src/Http/Middleware/RegistrationAllowed.php
RegistrationAllowed.handle
public function handle($request, Closure $next) { if (setting('registration', true) == 'no') return redirect()->guest('auth/login') ->with('error', 'Registration is administratively disabled.'); return $next($request); }
php
public function handle($request, Closure $next) { if (setting('registration', true) == 'no') return redirect()->guest('auth/login') ->with('error', 'Registration is administratively disabled.'); return $next($request); }
[ "public", "function", "handle", "(", "$", "request", ",", "Closure", "$", "next", ")", "{", "if", "(", "setting", "(", "'registration'", ",", "true", ")", "==", "'no'", ")", "return", "redirect", "(", ")", "->", "guest", "(", "'auth/login'", ")", "->",...
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @return mixed @throws \Seat\Services\Exceptions\SettingException
[ "Handle", "an", "incoming", "request", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Middleware/RegistrationAllowed.php#L38-L46
eveseat/web
src/Http/Controllers/Configuration/SeatController.php
SeatController.postUpdateSettings
public function postUpdateSettings(SeatSettings $request) { setting(['registration', $request->registration], true); setting(['admin_contact', $request->admin_contact], true); setting(['allow_tracking', $request->allow_tracking], true); setting(['cleanup_data', $request->cleanup_dat...
php
public function postUpdateSettings(SeatSettings $request) { setting(['registration', $request->registration], true); setting(['admin_contact', $request->admin_contact], true); setting(['allow_tracking', $request->allow_tracking], true); setting(['cleanup_data', $request->cleanup_dat...
[ "public", "function", "postUpdateSettings", "(", "SeatSettings", "$", "request", ")", "{", "setting", "(", "[", "'registration'", ",", "$", "request", "->", "registration", "]", ",", "true", ")", ";", "setting", "(", "[", "'admin_contact'", ",", "$", "reques...
@param \Seat\Web\Http\Validation\SeatSettings $request @return \Illuminate\Http\RedirectResponse @throws \Seat\Services\Exceptions\SettingException
[ "@param", "\\", "Seat", "\\", "Web", "\\", "Http", "\\", "Validation", "\\", "SeatSettings", "$request" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/SeatController.php#L69-L79
eveseat/web
src/Http/Controllers/Configuration/SeatController.php
SeatController.postPackagesCheck
public function postPackagesCheck(PackageVersionCheck $request) { // construct the packagist uri to its API $packagist_url = sprintf('https://packagist.org/packages/%s/%s.json', $request->input('vendor'), $request->input('package')); // retrieve package meta-data $respon...
php
public function postPackagesCheck(PackageVersionCheck $request) { // construct the packagist uri to its API $packagist_url = sprintf('https://packagist.org/packages/%s/%s.json', $request->input('vendor'), $request->input('package')); // retrieve package meta-data $respon...
[ "public", "function", "postPackagesCheck", "(", "PackageVersionCheck", "$", "request", ")", "{", "// construct the packagist uri to its API", "$", "packagist_url", "=", "sprintf", "(", "'https://packagist.org/packages/%s/%s.json'", ",", "$", "request", "->", "input", "(", ...
Determine if a package is or not outdated. @return \Illuminate\Http\JsonResponse @throws \GuzzleHttp\Exception\GuzzleException
[ "Determine", "if", "a", "package", "is", "or", "not", "outdated", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/SeatController.php#L118-L162
eveseat/web
src/Http/Controllers/Configuration/SeatController.php
SeatController.postPackagesChangelog
public function postPackagesChangelog(PackageChangelog $request) { $changelog_uri = $request->input('uri'); $changelog_body = $request->input('body'); $changelog_tag = $request->input('tag'); if (! is_null($changelog_body) && ! is_null($changelog_tag)) return $this->getC...
php
public function postPackagesChangelog(PackageChangelog $request) { $changelog_uri = $request->input('uri'); $changelog_body = $request->input('body'); $changelog_tag = $request->input('tag'); if (! is_null($changelog_body) && ! is_null($changelog_tag)) return $this->getC...
[ "public", "function", "postPackagesChangelog", "(", "PackageChangelog", "$", "request", ")", "{", "$", "changelog_uri", "=", "$", "request", "->", "input", "(", "'uri'", ")", ";", "$", "changelog_body", "=", "$", "request", "->", "input", "(", "'body'", ")",...
Return the changelog based on provided parameters. @return mixed|string @throws \GuzzleHttp\Exception\GuzzleException
[ "Return", "the", "changelog", "based", "on", "provided", "parameters", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/SeatController.php#L170-L180
eveseat/web
src/Http/Controllers/Configuration/SeatController.php
SeatController.getPluginsMetadataList
private function getPluginsMetadataList(): stdClass { app()->loadDeferredProviders(); $providers = array_keys(app()->getLoadedProviders()); $packages = (object) [ 'core' => collect(), 'plugins' => collect(), ]; foreach ($providers as $class) { ...
php
private function getPluginsMetadataList(): stdClass { app()->loadDeferredProviders(); $providers = array_keys(app()->getLoadedProviders()); $packages = (object) [ 'core' => collect(), 'plugins' => collect(), ]; foreach ($providers as $class) { ...
[ "private", "function", "getPluginsMetadataList", "(", ")", ":", "stdClass", "{", "app", "(", ")", "->", "loadDeferredProviders", "(", ")", ";", "$", "providers", "=", "array_keys", "(", "app", "(", ")", "->", "getLoadedProviders", "(", ")", ")", ";", "$", ...
Compute a list of provider class which are implementing SeAT package structure. @return \stdClass
[ "Compute", "a", "list", "of", "provider", "class", "which", "are", "implementing", "SeAT", "package", "structure", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/SeatController.php#L187-L214
eveseat/web
src/Http/Controllers/Configuration/SeatController.php
SeatController.getChangelogFromApi
private function getChangelogFromApi(string $uri, string $body_attribute, string $tag_attribute): string { try { return cache()->remember($this->getChangelogCacheKey($uri), 30, function () use ($uri, $body_attribute, $tag_attribute) { $changelog = ''; // retrieve...
php
private function getChangelogFromApi(string $uri, string $body_attribute, string $tag_attribute): string { try { return cache()->remember($this->getChangelogCacheKey($uri), 30, function () use ($uri, $body_attribute, $tag_attribute) { $changelog = ''; // retrieve...
[ "private", "function", "getChangelogFromApi", "(", "string", "$", "uri", ",", "string", "$", "body_attribute", ",", "string", "$", "tag_attribute", ")", ":", "string", "{", "try", "{", "return", "cache", "(", ")", "->", "remember", "(", "$", "this", "->", ...
Return a rendered changelog based on the provided release API endpoint. @param string $uri @param string $body_attribute @param string $tag_attribute @return string
[ "Return", "a", "rendered", "changelog", "based", "on", "the", "provided", "release", "API", "endpoint", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/SeatController.php#L224-L269
eveseat/web
src/Http/Controllers/Configuration/SeatController.php
SeatController.getChangelogFromFile
private function getChangelogFromFile(string $uri) { try { return cache()->remember($this->getChangelogCacheKey($uri), 30, function () use ($uri) { // retrieve changelog from provided uri $client = new Client(); $response = $client->request('GET', ...
php
private function getChangelogFromFile(string $uri) { try { return cache()->remember($this->getChangelogCacheKey($uri), 30, function () use ($uri) { // retrieve changelog from provided uri $client = new Client(); $response = $client->request('GET', ...
[ "private", "function", "getChangelogFromFile", "(", "string", "$", "uri", ")", "{", "try", "{", "return", "cache", "(", ")", "->", "remember", "(", "$", "this", "->", "getChangelogCacheKey", "(", "$", "uri", ")", ",", "30", ",", "function", "(", ")", "...
Return parsed markdown from the file located at the provided URI. @param string $uri @return mixed @throws \GuzzleHttp\Exception\GuzzleException
[ "Return", "parsed", "markdown", "from", "the", "file", "located", "at", "the", "provided", "URI", "." ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Configuration/SeatController.php#L278-L303
eveseat/web
src/Http/Controllers/Corporation/KillmailsController.php
KillmailsController.getKillmailsData
public function getKillmailsData(int $corporation_id) { $killmails = $this->getCorporationKillmails($corporation_id); return DataTables::of($killmails) ->addColumn('victim', function ($row) { if (is_null($row->killmail_victim)) return ''; ...
php
public function getKillmailsData(int $corporation_id) { $killmails = $this->getCorporationKillmails($corporation_id); return DataTables::of($killmails) ->addColumn('victim', function ($row) { if (is_null($row->killmail_victim)) return ''; ...
[ "public", "function", "getKillmailsData", "(", "int", "$", "corporation_id", ")", "{", "$", "killmails", "=", "$", "this", "->", "getCorporationKillmails", "(", "$", "corporation_id", ")", ";", "return", "DataTables", "::", "of", "(", "$", "killmails", ")", ...
@param int $corporation_id @return mixed @throws \Exception
[ "@param", "int", "$corporation_id" ]
train
https://github.com/eveseat/web/blob/397300911d4dc60a8a2e4cb06c9fd511f1b1558d/src/Http/Controllers/Corporation/KillmailsController.php#L56-L109
eveseat/eseye
src/Containers/EsiResponse.php
EsiResponse.parseHeaders
private function parseHeaders(array $headers) { // Set the raw headers as we got from the constructor. $this->raw_headers = $headers; // flatten the headers array so that values are not arrays themselves // but rather simple key value pairs. $headers = array_map(function ($...
php
private function parseHeaders(array $headers) { // Set the raw headers as we got from the constructor. $this->raw_headers = $headers; // flatten the headers array so that values are not arrays themselves // but rather simple key value pairs. $headers = array_map(function ($...
[ "private", "function", "parseHeaders", "(", "array", "$", "headers", ")", "{", "// Set the raw headers as we got from the constructor.", "$", "this", "->", "raw_headers", "=", "$", "headers", ";", "// flatten the headers array so that values are not arrays themselves", "// but ...
Parse an array of header key value pairs. Interesting header values such as X-Esi-Error-Limit-Remain and X-Pages are automatically mapped to properties in this object. @param array $headers
[ "Parse", "an", "array", "of", "header", "key", "value", "pairs", "." ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Containers/EsiResponse.php#L133-L159
eveseat/eseye
src/Containers/EsiResponse.php
EsiResponse.expired
public function expired(): bool { if ($this->expires()->lte( carbon()->now($this->expires()->timezoneName)) ) return true; return false; }
php
public function expired(): bool { if ($this->expires()->lte( carbon()->now($this->expires()->timezoneName)) ) return true; return false; }
[ "public", "function", "expired", "(", ")", ":", "bool", "{", "if", "(", "$", "this", "->", "expires", "(", ")", "->", "lte", "(", "carbon", "(", ")", "->", "now", "(", "$", "this", "->", "expires", "(", ")", "->", "timezoneName", ")", ")", ")", ...
Determine if this containers data should be considered expired. Expiry is calculated by taking the expiry time and comparing that to the local time. Before comparison though, the local time is converted to the timezone in which the expiry time is recorded. The resultant local time is then checked to ensure that the ex...
[ "Determine", "if", "this", "containers", "data", "should", "be", "considered", "expired", "." ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Containers/EsiResponse.php#L190-L199
eveseat/eseye
src/Fetchers/GuzzleFetcher.php
GuzzleFetcher.call
public function call( string $method, string $uri, array $body, array $headers = []): EsiResponse { // If we have authentication data, add the // Authorization header. if ($this->getAuthentication()) $headers = array_merge($headers, [ 'Authorization' => '...
php
public function call( string $method, string $uri, array $body, array $headers = []): EsiResponse { // If we have authentication data, add the // Authorization header. if ($this->getAuthentication()) $headers = array_merge($headers, [ 'Authorization' => '...
[ "public", "function", "call", "(", "string", "$", "method", ",", "string", "$", "uri", ",", "array", "$", "body", ",", "array", "$", "headers", "=", "[", "]", ")", ":", "EsiResponse", "{", "// If we have authentication data, add the", "// Authorization header.",...
@param string $method @param string $uri @param array $body @param array $headers @return mixed|\Seat\Eseye\Containers\EsiResponse @throws \Seat\Eseye\Exceptions\InvalidAuthenticationException @throws \Seat\Eseye\Exceptions\RequestFailedException @throws \Seat\Eseye\Exceptions\InvalidContainerDataException
[ "@param", "string", "$method", "@param", "string", "$uri", "@param", "array", "$body", "@param", "array", "$headers" ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Fetchers/GuzzleFetcher.php#L95-L107
eveseat/eseye
src/Fetchers/GuzzleFetcher.php
GuzzleFetcher.refreshToken
private function refreshToken() { // Make the post request for a new access_token $response = $this->httpRequest('post', $this->sso_base . '/token/?grant_type=refresh_token&refresh_token=' . $this->authentication->refresh_token, [ 'Authorization' => 'Basic ' ...
php
private function refreshToken() { // Make the post request for a new access_token $response = $this->httpRequest('post', $this->sso_base . '/token/?grant_type=refresh_token&refresh_token=' . $this->authentication->refresh_token, [ 'Authorization' => 'Basic ' ...
[ "private", "function", "refreshToken", "(", ")", "{", "// Make the post request for a new access_token", "$", "response", "=", "$", "this", "->", "httpRequest", "(", "'post'", ",", "$", "this", "->", "sso_base", ".", "'/token/?grant_type=refresh_token&refresh_token='", ...
Refresh the Access token that we have in the EsiAccess container. @throws \Seat\Eseye\Exceptions\RequestFailedException @throws \Seat\Eseye\Exceptions\InvalidAuthenticationException @throws \Seat\Eseye\Exceptions\InvalidContainerDataException
[ "Refresh", "the", "Access", "token", "that", "we", "have", "in", "the", "EsiAccess", "container", "." ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Fetchers/GuzzleFetcher.php#L164-L187
eveseat/eseye
src/Fetchers/GuzzleFetcher.php
GuzzleFetcher.httpRequest
public function httpRequest( string $method, string $uri, array $headers = [], array $body = []): EsiResponse { // Include some basic headers to those already passed in. Everything // is considered to be Json. $headers = array_merge($headers, [ 'Accept' => 'applica...
php
public function httpRequest( string $method, string $uri, array $headers = [], array $body = []): EsiResponse { // Include some basic headers to those already passed in. Everything // is considered to be Json. $headers = array_merge($headers, [ 'Accept' => 'applica...
[ "public", "function", "httpRequest", "(", "string", "$", "method", ",", "string", "$", "uri", ",", "array", "$", "headers", "=", "[", "]", ",", "array", "$", "body", "=", "[", "]", ")", ":", "EsiResponse", "{", "// Include some basic headers to those already...
@param string $method @param string $uri @param array $headers @param array $body @return mixed|\Seat\Eseye\Containers\EsiResponse @throws \Seat\Eseye\Exceptions\RequestFailedException @throws \Seat\Eseye\Exceptions\InvalidContainerDataException
[ "@param", "string", "$method", "@param", "string", "$uri", "@param", "array", "$headers", "@param", "array", "$body" ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Fetchers/GuzzleFetcher.php#L199-L269
eveseat/eseye
src/Fetchers/GuzzleFetcher.php
GuzzleFetcher.stripRefreshTokenValue
public function stripRefreshTokenValue(string $uri): string { // If we have 'refresh_token' in the URI, strip it. if (strpos($uri, 'refresh_token')) return Uri::withoutQueryValue((new Uri($uri)), 'refresh_token') ->__toString(); return $uri; }
php
public function stripRefreshTokenValue(string $uri): string { // If we have 'refresh_token' in the URI, strip it. if (strpos($uri, 'refresh_token')) return Uri::withoutQueryValue((new Uri($uri)), 'refresh_token') ->__toString(); return $uri; }
[ "public", "function", "stripRefreshTokenValue", "(", "string", "$", "uri", ")", ":", "string", "{", "// If we have 'refresh_token' in the URI, strip it.", "if", "(", "strpos", "(", "$", "uri", ",", "'refresh_token'", ")", ")", "return", "Uri", "::", "withoutQueryVal...
@param string $uri @return string
[ "@param", "string", "$uri" ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Fetchers/GuzzleFetcher.php#L299-L308
eveseat/eseye
src/Fetchers/GuzzleFetcher.php
GuzzleFetcher.makeEsiResponse
public function makeEsiResponse( string $body, array $headers, string $expires, int $status_code): EsiResponse { return new EsiResponse($body, $headers, $expires, $status_code); }
php
public function makeEsiResponse( string $body, array $headers, string $expires, int $status_code): EsiResponse { return new EsiResponse($body, $headers, $expires, $status_code); }
[ "public", "function", "makeEsiResponse", "(", "string", "$", "body", ",", "array", "$", "headers", ",", "string", "$", "expires", ",", "int", "$", "status_code", ")", ":", "EsiResponse", "{", "return", "new", "EsiResponse", "(", "$", "body", ",", "$", "h...
@param string $body @param array $headers @param string $expires @param int $status_code @return \Seat\Eseye\Containers\EsiResponse
[ "@param", "string", "$body", "@param", "array", "$headers", "@param", "string", "$expires", "@param", "int", "$status_code" ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Fetchers/GuzzleFetcher.php#L318-L323
eveseat/eseye
src/Fetchers/GuzzleFetcher.php
GuzzleFetcher.getAuthenticationScopes
public function getAuthenticationScopes(): array { // If we don't have any authentication data, then // only public calls can be made. if (is_null($this->getAuthentication())) return ['public']; // If there are no scopes that we know of, update them. // There wi...
php
public function getAuthenticationScopes(): array { // If we don't have any authentication data, then // only public calls can be made. if (is_null($this->getAuthentication())) return ['public']; // If there are no scopes that we know of, update them. // There wi...
[ "public", "function", "getAuthenticationScopes", "(", ")", ":", "array", "{", "// If we don't have any authentication data, then", "// only public calls can be made.", "if", "(", "is_null", "(", "$", "this", "->", "getAuthentication", "(", ")", ")", ")", "return", "[", ...
@return array @throws \Seat\Eseye\Exceptions\InvalidAuthenticationException @throws \Seat\Eseye\Exceptions\InvalidContainerDataException @throws \Seat\Eseye\Exceptions\RequestFailedException
[ "@return", "array" ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Fetchers/GuzzleFetcher.php#L332-L347
eveseat/eseye
src/Fetchers/GuzzleFetcher.php
GuzzleFetcher.setAuthenticationScopes
public function setAuthenticationScopes() { $scopes = $this->verifyToken()['Scopes']; // Add the internal 'public' scope $scopes = $scopes . ' public'; $this->authentication->scopes = explode(' ', $scopes); }
php
public function setAuthenticationScopes() { $scopes = $this->verifyToken()['Scopes']; // Add the internal 'public' scope $scopes = $scopes . ' public'; $this->authentication->scopes = explode(' ', $scopes); }
[ "public", "function", "setAuthenticationScopes", "(", ")", "{", "$", "scopes", "=", "$", "this", "->", "verifyToken", "(", ")", "[", "'Scopes'", "]", ";", "// Add the internal 'public' scope", "$", "scopes", "=", "$", "scopes", ".", "' public'", ";", "$", "t...
Query the eveseat/resources repository for SDE related information. @throws \Seat\Eseye\Exceptions\InvalidAuthenticationException @throws \Seat\Eseye\Exceptions\InvalidContainerDataException @throws \Seat\Eseye\Exceptions\RequestFailedException
[ "Query", "the", "eveseat", "/", "resources", "repository", "for", "SDE", "related", "information", "." ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Fetchers/GuzzleFetcher.php#L357-L365
eveseat/eseye
src/Cache/FileCache.php
FileCache.set
public function set(string $uri, string $query, EsiResponse $data) { $path = $this->buildRelativePath($this->safePath($uri), $query); // Create the subpath if that does not already exist if (! file_exists($path)) @mkdir($path, 0775, true); // Dump the contents to file ...
php
public function set(string $uri, string $query, EsiResponse $data) { $path = $this->buildRelativePath($this->safePath($uri), $query); // Create the subpath if that does not already exist if (! file_exists($path)) @mkdir($path, 0775, true); // Dump the contents to file ...
[ "public", "function", "set", "(", "string", "$", "uri", ",", "string", "$", "query", ",", "EsiResponse", "$", "data", ")", "{", "$", "path", "=", "$", "this", "->", "buildRelativePath", "(", "$", "this", "->", "safePath", "(", "$", "uri", ")", ",", ...
@param string $uri @param string $query @param \Seat\Eseye\Containers\EsiResponse $data @return mixed|void
[ "@param", "string", "$uri", "@param", "string", "$query", "@param", "\\", "Seat", "\\", "Eseye", "\\", "Containers", "\\", "EsiResponse", "$data" ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Cache/FileCache.php#L107-L118
eveseat/eseye
src/Cache/FileCache.php
FileCache.buildRelativePath
public function buildRelativePath(string $path, string $query = ''): string { // If the query string has data, hash it. if ($query != '') $query = $this->hashString($query); return rtrim(rtrim($this->cache_path, '/') . rtrim($path), '/') . '/' . $query . '/'; }
php
public function buildRelativePath(string $path, string $query = ''): string { // If the query string has data, hash it. if ($query != '') $query = $this->hashString($query); return rtrim(rtrim($this->cache_path, '/') . rtrim($path), '/') . '/' . $query . '/'; }
[ "public", "function", "buildRelativePath", "(", "string", "$", "path", ",", "string", "$", "query", "=", "''", ")", ":", "string", "{", "// If the query string has data, hash it.", "if", "(", "$", "query", "!=", "''", ")", "$", "query", "=", "$", "this", "...
@param string $path @param string $query @return string
[ "@param", "string", "$path", "@param", "string", "$query" ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Cache/FileCache.php#L126-L135
eveseat/eseye
src/Cache/FileCache.php
FileCache.has
public function has(string $uri, string $query = ''): bool { if ($status = $this->get($uri, $query)) return true; return false; }
php
public function has(string $uri, string $query = ''): bool { if ($status = $this->get($uri, $query)) return true; return false; }
[ "public", "function", "has", "(", "string", "$", "uri", ",", "string", "$", "query", "=", "''", ")", ":", "bool", "{", "if", "(", "$", "status", "=", "$", "this", "->", "get", "(", "$", "uri", ",", "$", "query", ")", ")", "return", "true", ";",...
@param string $uri @param string $query @return bool|mixed
[ "@param", "string", "$uri", "@param", "string", "$query" ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Cache/FileCache.php#L154-L161
eveseat/eseye
src/Cache/FileCache.php
FileCache.get
public function get(string $uri, string $query = '') { $path = $this->buildRelativePath($this->safePath($uri), $query); $cache_file_path = $path . $this->results_filename; // If we cant read from the cache, then just return false. if (! is_readable($cache_file_path)) re...
php
public function get(string $uri, string $query = '') { $path = $this->buildRelativePath($this->safePath($uri), $query); $cache_file_path = $path . $this->results_filename; // If we cant read from the cache, then just return false. if (! is_readable($cache_file_path)) re...
[ "public", "function", "get", "(", "string", "$", "uri", ",", "string", "$", "query", "=", "''", ")", "{", "$", "path", "=", "$", "this", "->", "buildRelativePath", "(", "$", "this", "->", "safePath", "(", "$", "uri", ")", ",", "$", "query", ")", ...
@param string $uri @param string $query @return mixed
[ "@param", "string", "$uri", "@param", "string", "$query" ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Cache/FileCache.php#L169-L191
eveseat/eseye
src/Cache/FileCache.php
FileCache.forget
public function forget(string $uri, string $query = '') { $path = $this->buildRelativePath($uri, $query); $cache_file_path = $path . $this->results_filename; @unlink($cache_file_path); }
php
public function forget(string $uri, string $query = '') { $path = $this->buildRelativePath($uri, $query); $cache_file_path = $path . $this->results_filename; @unlink($cache_file_path); }
[ "public", "function", "forget", "(", "string", "$", "uri", ",", "string", "$", "query", "=", "''", ")", "{", "$", "path", "=", "$", "this", "->", "buildRelativePath", "(", "$", "uri", ",", "$", "query", ")", ";", "$", "cache_file_path", "=", "$", "...
@param string $uri @param string $query @return void
[ "@param", "string", "$uri", "@param", "string", "$query" ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Cache/FileCache.php#L199-L206
eveseat/eseye
src/Cache/MemcachedCache.php
MemcachedCache.set
public function set(string $uri, string $query, EsiResponse $data) { if ($this->is_memcached) $this->memcached->set($this->buildCacheKey($uri, $query), serialize($data), 0); else $this->memcached->set($this->buildCacheKey($uri, $query), serialize($data), $this->flags, 0); ...
php
public function set(string $uri, string $query, EsiResponse $data) { if ($this->is_memcached) $this->memcached->set($this->buildCacheKey($uri, $query), serialize($data), 0); else $this->memcached->set($this->buildCacheKey($uri, $query), serialize($data), $this->flags, 0); ...
[ "public", "function", "set", "(", "string", "$", "uri", ",", "string", "$", "query", ",", "EsiResponse", "$", "data", ")", "{", "if", "(", "$", "this", "->", "is_memcached", ")", "$", "this", "->", "memcached", "->", "set", "(", "$", "this", "->", ...
@param string $uri @param string $query @param \Seat\Eseye\Containers\EsiResponse $data @return void
[ "@param", "string", "$uri", "@param", "string", "$query", "@param", "\\", "Seat", "\\", "Eseye", "\\", "Containers", "\\", "EsiResponse", "$data" ]
train
https://github.com/eveseat/eseye/blob/55a90ccd49b548cb417ace32075a9188b8d9c1af/src/Cache/MemcachedCache.php#L97-L104