-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from romo4ko/dev
Dev
- Loading branch information
Showing
27 changed files
with
803 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,3 @@ jobs: | |
composer install | ||
php artisan migrate --force | ||
php artisan cache:clear | ||
npm ci | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CI-BUILD-TEST | ||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
coding-standard: | ||
name: Coding Standard | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.3' | ||
coverage: none | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress --no-suggest --prefer-dist --no-interaction --ignore-platform-reqs | ||
|
||
- name: Check coding style | ||
run: composer cs-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Achievement extends Model | ||
{ | ||
use HasFactory; | ||
|
||
protected $fillable = ['name', 'description', 'image_id']; | ||
|
||
public function challenges() | ||
{ | ||
return $this->hasMany(Challenge::class); | ||
} | ||
|
||
public function image() | ||
{ | ||
return $this->belongsTo(Image::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Category extends Model | ||
{ | ||
use HasFactory; | ||
|
||
protected $fillable = ['name']; | ||
|
||
public function challenges () | ||
{ | ||
return $this->hasMany(Challenge::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Challenge extends Model | ||
{ | ||
use HasFactory; | ||
|
||
protected $fillable = [ | ||
'name', | ||
'description', | ||
'category_id', | ||
'start_date', | ||
'end_date', | ||
'achievement_id', | ||
'image_id' | ||
]; | ||
|
||
public function users() | ||
{ | ||
return $this->belongsToMany(User::class, 'users_challenges'); | ||
} | ||
|
||
public function image() | ||
{ | ||
return $this->belongsTo(Image::class); | ||
} | ||
|
||
public function category() | ||
{ | ||
return $this->belongsTo(Category::class); | ||
} | ||
|
||
public function achievement() | ||
{ | ||
return $this->belongsTo(Achievement::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Image extends Model | ||
{ | ||
use HasFactory; | ||
|
||
protected $fillable = ['image_path']; | ||
|
||
public function users() | ||
{ | ||
return $this->hasMany(User::class); | ||
} | ||
|
||
public function challenges() | ||
{ | ||
return $this->hasMany(Challenge::class); | ||
} | ||
|
||
public function achievements() | ||
{ | ||
return $this->hasMany(Achievement::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.