Skip to content

Commit

Permalink
Merge tag 'v1.1.0' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
jobara committed Jul 25, 2023
2 parents f99aabc + d397803 commit 6c302f4
Show file tree
Hide file tree
Showing 44 changed files with 1,936 additions and 3,230 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/asset-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: actions/setup-node@v3
if: steps.git-diff.outputs.diff
with:
node-version: "16"
node-version-file: ".nvmrc"
- name: Cache node modules
if: steps.git-diff.outputs.diff
uses: actions/cache@v3
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/deploy-dev.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- uses: actions/setup-node@v3
if: steps.git-diff.outputs.diff
with:
node-version: "16"
node-version-file: ".nvmrc"
- name: Cache node modules
if: steps.git-diff.outputs.diff
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- uses: actions/setup-node@v3
if: steps.git-diff.outputs.diff
with:
node-version: "16"
node-version-file: ".nvmrc"
- name: Cache node modules
if: steps.git-diff.outputs.diff
uses: actions/cache@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- uses: actions/setup-node@v3
if: steps.git-diff.outputs.diff
with:
node-version: "16"
node-version-file: ".nvmrc"
- name: Cache node modules
if: steps.git-diff.outputs.diff
uses: actions/cache@v3
Expand Down Expand Up @@ -76,11 +76,11 @@ jobs:
env:
DB_PASSWORD: root
DB_HOST: localhost
- name: Use Node 16.x
- name: Use Node from .nvmrc file
if: steps.git-diff.outputs.diff
uses: actions/setup-node@v3
with:
node-version: 16
node-version-file: ".nvmrc"
- name: Run Lighthouse CI
if: steps.git-diff.outputs.diff
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/mirror-dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Mirror dev to GitLab

on:
workflow_dispatch:
push:
branches:
- dev
Expand All @@ -23,7 +24,7 @@ jobs:
git remote add gitlab ${{ vars.GITLAB_URL }}
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GITLAB_SSH_KEY }}

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/mirror-production.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Mirror production to GitLab

on:
workflow_dispatch:
push:
branches:
- production
Expand All @@ -23,7 +24,7 @@ jobs:
git remote add gitlab ${{ vars.GITLAB_URL }}
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GITLAB_SSH_KEY }}

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/mirror-staging.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Mirror staging to GitLab

on:
workflow_dispatch:
push:
branches:
- staging
Expand All @@ -23,7 +24,7 @@ jobs:
git remote add gitlab ${{ vars.GITLAB_URL }}
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GITLAB_SSH_KEY }}

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/mirror-tags.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Mirror tags to GitLab

on:
workflow_dispatch:
push:
tags:
- '*'
Expand All @@ -23,7 +24,7 @@ jobs:
git remote add gitlab ${{ vars.GITLAB_URL }}
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GITLAB_SSH_KEY }}

Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/refresh-dev.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .kube/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM php:8.1-fpm

ENV PHP_VERSION 8.1
ENV NODE_VERSION 16
ENV NODE_VERSION 18
ENV NVM_VERSION 0.39.3
ENV NVM_DIR /root/.nvm

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
2 changes: 1 addition & 1 deletion Dockerfile.cloud
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:22.04

LABEL maintainer="Taylor Otwell"

ARG NODE_VERSION=16
ARG NODE_VERSION=18

WORKDIR /var/www/html

Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ The platform requires the following:
- [PHP](https://www.php.net/supported-versions.php) >= 8.1 with [required extensions](https://laravel.com/docs/9.x/deployment#server-requirements)
- [MySQL](https://dev.mysql.com/downloads/) >= 5.7
- [Composer](https://getcomposer.org) >= 2.0
- [Node](https://nodejs.org) >= 18

Optionally you may wish to install [NVM](https://github.com/nvm-sh/nvm) to make node version management easier.

The deployment process should follow all the recommended [optimization processes](https://laravel.com/docs/9.x/deployment#optimization).

Expand Down Expand Up @@ -124,8 +127,8 @@ For comprehensive instructions, consult the [Laravel documentation](https://lara
of how some key tasks can be carried out using Sail:
- [Composer](https://getcomposer.org) commands may be executed by using `sail composer <command>`.
- [NPM](https://docs.npmjs.com/cli/v7) commands may be executed by using `sail npm <command>`.
- [Artisan](https://laravel.com/docs/8.x/artisan) commands may be executed by using `sail artisan <command>`.
- [NPM](https://docs.npmjs.com/cli) commands may be executed by using `sail npm <command>`.
- [Artisan](https://laravel.com/docs/9.x/artisan) commands may be executed by using `sail artisan <command>`.
### Local development setup using Laravel Valet
Expand Down Expand Up @@ -178,8 +181,15 @@ of how some key tasks can be carried out using Sail:
9. Install Composer and NPM dependencies:
```bash
# install composer dependencies
composer install
npm install
# To use the version of npm specified in .nvmrc.
# requires https://github.com/nvm-sh/nvm
nvm use
# install node dependencies
npm ci
```
10. Generate an application key:
Expand Down Expand Up @@ -233,8 +243,9 @@ For comprehensive instructions, consult the [Laravel documentation](https://lara
of how some key tasks can be carried out using Valet:

- [Composer](https://getcomposer.org) commands may be executed by using `composer <command>`.
- [NPM](https://docs.npmjs.com/cli/v7) commands may be executed by using `npm <command>`.
- [Artisan](https://laravel.com/docs/8.x/artisan) commands may be executed by using `php artisan <command>`.
- [NVM](https://github.com/nvm-sh/nvm) commands may be executed by using `nvm <command>`.
- [NPM](https://docs.npmjs.com/cli) commands may be executed by using `npm <command>`.
- [Artisan](https://laravel.com/docs/9.x/artisan) commands may be executed by using `php artisan <command>`.

### Running tests

Expand Down
6 changes: 5 additions & 1 deletion app/Models/Course.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,21 @@ class Course extends Model
'title',
'introduction',
'video',
'author',
];

protected $casts = [
'title' => 'array',
'introduction' => 'array',
'video' => 'array',
'author' => 'array',
];

public array $translatable = [
'title',
'introduction',
'video',
'author',
'slug',
];

Expand All @@ -45,7 +48,8 @@ public function getSlugOptions(): SlugOptions
->generateSlugsFrom(function (Course $model, $locale): string {
return $this->generateSlugs($model, $locale, 'title');
})
->saveSlugsTo('slug');
->saveSlugsTo('slug')
->slugsShouldBeNoLongerThan(250);
}

public function getRouteKeyName(): string
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function getRouteKeyName(): string
public function users(): BelongsToMany
{
return $this->belongsToMany(User::class)
->withPivot('started_content_at', 'finished_content_at', 'completed_at')
->withPivot('started_content_at', 'finished_content_at')
->withTimestamps();
}

Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public function courses(): BelongsToMany
public function modules(): BelongsToMany
{
return $this->belongsToMany(Module::class)
->withPivot('started_content_at', 'finished_content_at', 'completed_at')
->withPivot('started_content_at', 'finished_content_at')
->withTimestamps();
}

Expand Down
Loading

0 comments on commit 6c302f4

Please sign in to comment.