GitHub
Tests: 12 • Commercial: 2 • Pet projects: 4 • Legacy: 4
Total: 22

.NET Framework

Test
2021

Project Request

ASP.NET MVC • C# • SQL Server
Idea of the project: if someone wants to order a project development, here you can send an application.
Test
2020

ProjectC

ASP.NET MVC • C# • JSON • jQuery
JSON data processing.
Test
2020

Vehicle Maintenance

ASP.NET MVC • VB.NET • JSON
Idea of the project: if someone wants to order a project development, here you can send an application.
Test
2019

Movie Navigator

ASP.NET MVC • VB.NET
Request information about movie from IMDB.
Test
2018

Customers Exchange

ASP.NET MVC • C# • SQL Server
Automated teller machine emulation.
Test
2016

ATM

ASP.NET MVC • C#
Automated teller machine emulation.

.NET Core

Pet project
2022

Mail Daemon

.NET 9 • Console • JSON
Utility to send mails with customizable settings.

Custom

Code
2024

Buns of code

.NET Framework • C# • JavaScript
Code snippets from my projects, ready to use; tiny tests; code examples.

PHP

Test
2024

Mediabox

PHP 8 • Laravel 11 • Vue.js • Composer • SQLite
Test project for media files management.
Test
2020

Loan Castle

PHP • MariaDB
Jums jāizstrādā kāda lielāk projekta prototips. Izstrādājot prototipu, paturiet prātā, ka projektam attīstoties, šo prototipu varētu vajadzēt pilnveidot.
Test
2020

Content Management

PHP • MySQL • AJAX
Создать простой сайт, где будет страница с формой для авторизации и страница для авторизованного пользователя.
Test
2019

Laravel

PHP • Laravel • Vue.js • Composer • SQLite
Izveidot aplikāciju, kura ik pēc noteikta intervāla (60 sekundes) veic ierakstu datubāzē izmantojot Laravel freimworka iebūvēto funkcionalitāti.
Test
2019

Phone Check

PHP • JavaScript • JSON • Docker
Implement application to detect country by phone number.

Frontend

Test
2021

Forex Wall

npm • React
For this exercise, what we need is a simple live wall for tracking currencies.

Business projects

Commercial
2008

Certification Center

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • SQL Server • ADO.NET • Dapper • JavaScript • jQuery • Git
Transport registration and certification services in Latvia, Customer Relationship Management.
Commercial
2000

Amerikas Auto

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • SQL Server • ADO.NET • Entity Framework • JavaScript • jQuery • Git
Car service and spare parts for all USA and European car models, Customer Relationship Management.

Pet projects

Pet project
2023

Geolocation Assistant

.NET 8 • ASP.NET Core • C# • Web API • JSON • Git
Website for determining geolocation by IP or geotagged photo.
Pet project
2008

Web Dynamics

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • Web API • JSON • SQL Server • Dapper • JavaScript • jQuery • SVG • Git
Software development blog. Articles, books, videos, content management.
Pet project
2000

Blackball

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • Web API • JSON • XML • SQL Server • Dapper • JavaScript • jQuery • SVG • Git
My entertainment portal created from scratch.

Good old times

Legacy
2000

DOS Clock

Turbo Pascal • Assembler
Digital clock.
Legacy
2000

BrainOut

Turbo Pascal • Assembler
Tank battle game.
Legacy
1999

Airport Administrator

Turbo Pascal
Курсовая работа в институте.
Legacy
1998

Atomizer

Turbo Pascal • Assembler
Atomizer, aka «Studio2D». Graphic raster editor. AGI is my own «Atomizer Generated Image» file format.

Mediabox

2024 Test

Test project for media files management.

PHP 8 Laravel 11 Vue.js Composer SQLite
Information
Source code
  app
  Http
  .bin
  vite
  lib
  dist
  esm
  node
  lib
  core
  env
  node
  lib
  lib
  lib
  lib
  dist
  lib
  lib
  dist
  es
  lib
  vite
  dist
  node
  dist
  css
  js
  app
  data
  logs
  Unit
  math
  src
  src
  src
  docs
  en
  lib
  src
  src
  Cron
  src
  src
  Core
  ORM
  Spot
  filp
  src
  css
  js
  Util
  src
  src
  src
  src
  psr7
  src
  src
  Core
  Text
  Type
  Xml
  Core
  Text
  Type
  Xml
  src
  Auth
  make
  Bus
  View
  Auth
  Bus
  Http
  Mail
  View
  Auth
  Bus
  Http
  dist
  Http
  Json
  Log
  Mail
  html
  text
  Jobs
  lang
  en
  View
  pint
  pint
  src
  sail
  8.0
  8.1
  8.2
  8.3
  src
  src
  src
  src
  Node
  Util
  Node
  Node
  Node
  Data
  Node
  Node
  Util
  Xml
  src
  src
  src
  docs
  Pass
  src
  Curl
  Test
  src
  Date
  Spl
  lazy
  src
  Cli
  Lang
  List
  src
  src
  lib
  Node
  Expr
  Cast
  Name
  Stmt
  src
  src
  Html
  src
  xml
  src
  src
  src
  Data
  Node
  Html
  css
  js
  Xml
  Util
  src
  src
  src
  src
  src
  Test
  Test
  Math
  Type
  Api
  Rule
  Stub
  Api
  PHPT
  Cli
  Xml
  Util
  PHP
  Xml
  psr
  src
  src
  src
  src
  src
  docs
  src
  log
  src
  src
  psy
  src
  Hoa
  77
  78
  Sudo
  Util
  src
  src
  Map
  Tool
  uuid
  src
  Time
  Guid
  Lazy
  Math
  Dce
  Node
  Time
  Type
  src
  src
  src
  src
  src
  diff
  src
  src
  src
  src
  src
  src
  src
  src
  type
  src
  type
  src
  Test
  CI
  Node
  css
  js
  File
  Test
  Log
  Test
  Smtp
  Auth
  mime
  Part
  Test
  Test
  data
  data
  Test
  Util
  Test
  uid
  css
  js
  Test
  yaml
  Tag
  src
  src
  Css
  Rule
  src
  File
  Util
  voku
  src
  voku
  data
  src
  .env
Root / vendor / laravel / framework / src / Illuminate / Database / Eloquent / Relations / HasOneOrMany.php
<?php namespace Illuminate\Database\Eloquent\Relations; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\Concerns\InteractsWithDictionary; use Illuminate\Database\UniqueConstraintViolationException; /** * @template TRelatedModel of \Illuminate\Database\Eloquent\Model * @template TDeclaringModel of \Illuminate\Database\Eloquent\Model * @template TResult * * @extends \Illuminate\Database\Eloquent\Relations\Relation<TRelatedModel, TDeclaringModel, TResult> */ abstract class HasOneOrMany extends Relation { use InteractsWithDictionary; /** * The foreign key of the parent model. * * @var string */ protected $foreignKey; /** * The local key of the parent model. * * @var string */ protected $localKey; /** * Create a new has one or many relationship instance. * * @param \Illuminate\Database\Eloquent\Builder<TRelatedModel> $query * @param TDeclaringModel $parent * @param string $foreignKey * @param string $localKey * @return void */ public function __construct(Builder $query, Model $parent, $foreignKey, $localKey) { $this->localKey = $localKey; $this->foreignKey = $foreignKey; parent::__construct($query, $parent); } /** * Create and return an un-saved instance of the related model. * * @param array $attributes * @return TRelatedModel */ public function make(array $attributes = []) { return tap($this->related->newInstance($attributes), function ($instance) { $this->setForeignAttributesForCreate($instance); }); } /** * Create and return an un-saved instance of the related models. * * @param iterable $records * @return \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> */ public function makeMany($records) { $instances = $this->related->newCollection(); foreach ($records as $record) { $instances->push($this->make($record)); } return $instances; } /** * Set the base constraints on the relation query. * * @return void */ public function addConstraints() { if (static::$constraints) { $query = $this->getRelationQuery(); $query->where($this->foreignKey, '=', $this->getParentKey()); $query->whereNotNull($this->foreignKey); } } /** @inheritDoc */ public function addEagerConstraints(array $models) { $whereIn = $this->whereInMethod($this->parent, $this->localKey); $this->whereInEager( $whereIn, $this->foreignKey, $this->getKeys($models, $this->localKey), $this->getRelationQuery() ); } /** * Match the eagerly loaded results to their single parents. * * @param array<int, TDeclaringModel> $models * @param \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> $results * @param string $relation * @return array<int, TDeclaringModel> */ public function matchOne(array $models, Collection $results, $relation) { return $this->matchOneOrMany($models, $results, $relation, 'one'); } /** * Match the eagerly loaded results to their many parents. * * @param array<int, TDeclaringModel> $models * @param \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> $results * @param string $relation * @return array<int, TDeclaringModel> */ public function matchMany(array $models, Collection $results, $relation) { return $this->matchOneOrMany($models, $results, $relation, 'many'); } /** * Match the eagerly loaded results to their many parents. * * @param array<int, TDeclaringModel> $models * @param \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> $results * @param string $relation * @param string $type * @return array<int, TDeclaringModel> */ protected function matchOneOrMany(array $models, Collection $results, $relation, $type) { $dictionary = $this->buildDictionary($results); // Once we have the dictionary we can simply spin through the parent models to // link them up with their children using the keyed dictionary to make the // matching very convenient and easy work. Then we'll just return them. foreach ($models as $model) { if (isset($dictionary[$key = $this->getDictionaryKey($model->getAttribute($this->localKey))])) { $model->setRelation( $relation, $this->getRelationValue($dictionary, $key, $type) ); } } return $models; } /** * Get the value of a relationship by one or many type. * * @param array $dictionary * @param string $key * @param string $type * @return mixed */ protected function getRelationValue(array $dictionary, $key, $type) { $value = $dictionary[$key]; return $type === 'one' ? reset($value) : $this->related->newCollection($value); } /** * Build model dictionary keyed by the relation's foreign key. * * @param \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> $results * @return array<array<int, TRelatedModel>> */ protected function buildDictionary(Collection $results) { $foreign = $this->getForeignKeyName(); return $results->mapToDictionary(function ($result) use ($foreign) { return [$this->getDictionaryKey($result->{$foreign}) => $result]; })->all(); } /** * Find a model by its primary key or return a new instance of the related model. * * @param mixed $id * @param array $columns * @return ($id is (\Illuminate\Contracts\Support\Arrayable<array-key, mixed>|array<mixed>) ? \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> : TRelatedModel) */ public function findOrNew($id, $columns = ['*']) { if (is_null($instance = $this->find($id, $columns))) { $instance = $this->related->newInstance(); $this->setForeignAttributesForCreate($instance); } return $instance; } /** * Get the first related model record matching the attributes or instantiate it. * * @param array $attributes * @param array $values * @return TRelatedModel */ public function firstOrNew(array $attributes = [], array $values = []) { if (is_null($instance = $this->where($attributes)->first())) { $instance = $this->related->newInstance(array_merge($attributes, $values)); $this->setForeignAttributesForCreate($instance); } return $instance; } /** * Get the first record matching the attributes. If the record is not found, create it. * * @param array $attributes * @param array $values * @return TRelatedModel */ public function firstOrCreate(array $attributes = [], array $values = []) { if (is_null($instance = (clone $this)->where($attributes)->first())) { $instance = $this->createOrFirst($attributes, $values); } return $instance; } /** * Attempt to create the record. If a unique constraint violation occurs, attempt to find the matching record. * * @param array $attributes * @param array $values * @return TRelatedModel */ public function createOrFirst(array $attributes = [], array $values = []) { try { return $this->getQuery()->withSavepointIfNeeded(fn () => $this->create(array_merge($attributes, $values))); } catch (UniqueConstraintViolationException $e) { return $this->useWritePdo()->where($attributes)->first() ?? throw $e; } } /** * Create or update a related record matching the attributes, and fill it with values. * * @param array $attributes * @param array $values * @return TRelatedModel */ public function updateOrCreate(array $attributes, array $values = []) { return tap($this->firstOrCreate($attributes, $values), function ($instance) use ($values) { if (! $instance->wasRecentlyCreated) { $instance->fill($values)->save(); } }); } /** * Insert new records or update the existing ones. * * @param array $values * @param array|string $uniqueBy * @param array|null $update * @return int */ public function upsert(array $values, $uniqueBy, $update = null) { if (! empty($values) && ! is_array(reset($values))) { $values = [$values]; } foreach ($values as $key => $value) { $values[$key][$this->getForeignKeyName()] = $this->getParentKey(); } return $this->getQuery()->upsert($values, $uniqueBy, $update); } /** * Attach a model instance to the parent model. * * @param TRelatedModel $model * @return TRelatedModel|false */ public function save(Model $model) { $this->setForeignAttributesForCreate($model); return $model->save() ? $model : false; } /** * Attach a model instance without raising any events to the parent model. * * @param TRelatedModel $model * @return TRelatedModel|false */ public function saveQuietly(Model $model) { return Model::withoutEvents(function () use ($model) { return $this->save($model); }); } /** * Attach a collection of models to the parent instance. * * @param iterable<TRelatedModel> $models * @return iterable<TRelatedModel> */ public function saveMany($models) { foreach ($models as $model) { $this->save($model); } return $models; } /** * Attach a collection of models to the parent instance without raising any events to the parent model. * * @param iterable<TRelatedModel> $models * @return iterable<TRelatedModel> */ public function saveManyQuietly($models) { return Model::withoutEvents(function () use ($models) { return $this->saveMany($models); }); } /** * Create a new instance of the related model. * * @param array $attributes * @return TRelatedModel */ public function create(array $attributes = []) { return tap($this->related->newInstance($attributes), function ($instance) { $this->setForeignAttributesForCreate($instance); $instance->save(); }); } /** * Create a new instance of the related model without raising any events to the parent model. * * @param array $attributes * @return TRelatedModel */ public function createQuietly(array $attributes = []) { return Model::withoutEvents(fn () => $this->create($attributes)); } /** * Create a new instance of the related model. Allow mass-assignment. * * @param array $attributes * @return TRelatedModel */ public function forceCreate(array $attributes = []) { $attributes[$this->getForeignKeyName()] = $this->getParentKey(); return $this->related->forceCreate($attributes); } /** * Create a new instance of the related model with mass assignment without raising model events. * * @param array $attributes * @return TRelatedModel */ public function forceCreateQuietly(array $attributes = []) { return Model::withoutEvents(fn () => $this->forceCreate($attributes)); } /** * Create a Collection of new instances of the related model. * * @param iterable $records * @return \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> */ public function createMany(iterable $records) { $instances = $this->related->newCollection(); foreach ($records as $record) { $instances->push($this->create($record)); } return $instances; } /** * Create a Collection of new instances of the related model without raising any events to the parent model. * * @param iterable $records * @return \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> */ public function createManyQuietly(iterable $records) { return Model::withoutEvents(fn () => $this->createMany($records)); } /** * Set the foreign ID for creating a related model. * * @param TRelatedModel $model * @return void */ protected function setForeignAttributesForCreate(Model $model) { $model->setAttribute($this->getForeignKeyName(), $this->getParentKey()); } /** @inheritDoc */ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { if ($query->getQuery()->from == $parentQuery->getQuery()->from) { return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns); } return parent::getRelationExistenceQuery($query, $parentQuery, $columns); } /** * Add the constraints for a relationship query on the same table. * * @param \Illuminate\Database\Eloquent\Builder<TRelatedModel> $query * @param \Illuminate\Database\Eloquent\Builder<TDeclaringModel> $parentQuery * @param array|mixed $columns * @return \Illuminate\Database\Eloquent\Builder<TRelatedModel> */ public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) { $query->from($query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash()); $query->getModel()->setTable($hash); return $query->select($columns)->whereColumn( $this->getQualifiedParentKeyName(), '=', $hash.'.'.$this->getForeignKeyName() ); } /** * Alias to set the "limit" value of the query. * * @param int $value * @return $this */ public function take($value) { return $this->limit($value); } /** * Set the "limit" value of the query. * * @param int $value * @return $this */ public function limit($value) { if ($this->parent->exists) { $this->query->limit($value); } else { $this->query->groupLimit($value, $this->getExistenceCompareKey()); } return $this; } /** * Get the key for comparing against the parent key in "has" query. * * @return string */ public function getExistenceCompareKey() { return $this->getQualifiedForeignKeyName(); } /** * Get the key value of the parent's local key. * * @return mixed */ public function getParentKey() { return $this->parent->getAttribute($this->localKey); } /** * Get the fully qualified parent key name. * * @return string */ public function getQualifiedParentKeyName() { return $this->parent->qualifyColumn($this->localKey); } /** * Get the plain foreign key. * * @return string */ public function getForeignKeyName() { $segments = explode('.', $this->getQualifiedForeignKeyName()); return end($segments); } /** * Get the foreign key for the relationship. * * @return string */ public function getQualifiedForeignKeyName() { return $this->foreignKey; } /** * Get the local key for the relationship. * * @return string */ public function getLocalKeyName() { return $this->localKey; } }