Skip to content

Commit

Permalink
Merge branch '1.2' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Jul 19, 2024
2 parents bf17409 + 9395ca4 commit 4d83149
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 68 deletions.
2 changes: 1 addition & 1 deletion console/asset-compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Introduction

Winter brings first-class support for handling Node-based compilation for frontend assets through the Mix commands. The comamnds use the [Laravel Mix](https://laravel-mix.com/) wrapper, a user-friendly and simple interface for setting up compilation of multiple types of frontend assets through Webpack and various libraries.
Winter brings first-class support for handling Node-based compilation for frontend assets through the Mix commands. The commands use the [Laravel Mix](https://laravel-mix.com/) wrapper, a user-friendly and simple interface for setting up compilation of multiple types of frontend assets through Webpack and various libraries.

### Requirements

Expand Down
17 changes: 17 additions & 0 deletions database/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,23 @@ Schema::table('users', function ($table) {
});
```

You can also use the `dropColumnIfExists` method on the Schema builder for a slightly safer way of handling migrations:

```php
Schema::table('users', function ($table) {
$table->dropColumnIfExists('single_column');
// or
$table->dropColumnIfExists('one_column', 'two_column');
// or
$table->dropColumnIfExists([
'one_column',
'two_column',
'red_column',
'blue_column',
]);
}
```

### Creating indexes

The schema builder supports several types of indexes. First, let's look at an example that specifies a column's values should be unique. To create the index, we can simply chain the `unique` method onto the column definition:
Expand Down
35 changes: 13 additions & 22 deletions plugin/unit-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,43 +137,34 @@ name: Tests

on:
push:
pull_request:

jobs:
unitTests:
runs-on: ubuntu-latest
name: Unit Tests
steps:
- name: Checkout Winter CMS
uses: actions/checkout@v4
with:
repository: wintercms/winter
ref: develop # change this to a different branch or tag name if you wish to test with a specific version of Winter CMS

- name: Checkout code
uses: actions/checkout@v4
with:
path: my-plugin
path: plugins/my-author/my-plugin # change this to the correct folder for your plugin

- name: Setup PHP and extensions
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.3 # change this if you wish to test a different PHP version
extensions: mbstring, intl, gd, xml, sqlite
tools: composer:v2

- name: Install Winter
run: |
wget https://github.com/wintercms/winter/archive/develop.zip
unzip develop.zip
rm develop.zip
# Move Winter CMS into place
shopt -s dotglob
mv winter-develop/* ./
rmdir winter-develop
shopt -u dotglob
mv config/cms.php config/testing/cms.php
# Move plugin into place (note that the paths below should be changed to match your plugin path)
mkdir -p plugins/myauthor
mv my-plugin plugins/myauthor/myplugin
- name: Install Composer dependencies
run: composer install --no-interaction --no-progress
run: composer install --no-interaction --no-progress --no-scripts

- name: Run unit tests
run: php artisan winter:test -p MyAuthor.MyPlugin
run: php artisan winter:test -p MyAuthor.MyPlugin # change this to the correct plugin code
```
91 changes: 46 additions & 45 deletions services/helpers.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- markdownlint-disable MD051 -->
# Helpers

Winter includes a variety of "helper" PHP functions. Many of these functions are used internally by Winter itself, however, you are free to use them in your own plugins and applications if you find them useful.
Expand All @@ -9,22 +10,22 @@ For more useful methods, you should also review the [Laravel `Arr::*()` helpers]

<div class="columned-list">

- [array_add](#array_add)
- [array_divide](#array_divide)
- [array_dot](#array_dot)
- [array_undot](#array_undot)
- [array_except](#array_except)
- [array_first](#array_first)
- [array_flatten](#array_flatten)
- [array_forget](#array_forget)
- [array_get](#array_get)
- [array_only](#array_only)
- [array_pluck](#array_pluck)
- [array_pull](#array_pull)
- [array_set](#array_set)
- [array_sort](#array_sort)
- [array_sort_recursive](#array_sort_recursive)
- [array_where](#array_where)
- [array_add](#arrayadd)
- [array_divide](#arraydivide)
- [array_dot](#arraydot)
- [array_undot](#arrayundot)
- [array_except](#arrayexcept)
- [array_first](#arrayfirst)
- [array_flatten](#arrayflatten)
- [array_forget](#arrayforget)
- [array_get](#arrayget)
- [array_only](#arrayonly)
- [array_pluck](#arraypluck)
- [array_pull](#arraypull)
- [array_set](#arrayset)
- [array_sort](#arraysort)
- [array_sort_recursive](#arraysortrecursive)
- [array_where](#arraywhere)
- [head](#head)
- [last](#last)

Expand All @@ -36,17 +37,17 @@ Paths
<div class="columned-list">

- [Path Symbols](#path-symbols)
- [app_path](#app_path)
- [base_path](#base_path)
- [config_path](#config_path)
- [database_path](#database_path)
- [media_path](#media_path)
- [plugins_path](#plugins_path)
- [public_path](#public_path)
- [storage_path](#storage_path)
- [temp_path](#temp_path)
- [themes_path](#themes_path)
- [uploads_path](#uploads_path)
- [app_path](#apppath)
- [base_path](#basepath)
- [config_path](#configpath)
- [database_path](#databasepath)
- [media_path](#mediapath)
- [plugins_path](#pluginspath)
- [public_path](#publicpath)
- [storage_path](#storagepath)
- [temp_path](#temppath)
- [themes_path](#themespath)
- [uploads_path](#uploadspath)

</div>

Expand All @@ -57,23 +58,23 @@ For more useful methods, you should also review the [Laravel `Str::*()` helpers]

<div class="columned-list">

- [camel_case](#camel_case)
- [class_basename](#class_basename)
- [camel_case](#camelcase)
- [class_basename](#classbasename)
- [e](#e)
- [ends_with](#ends_with)
- [snake_case](#snake_case)
- [str_limit](#str_limit)
- [starts_with](#starts_with)
- [str_contains](#str_contains)
- [str_finish](#str_finish)
- [str_is](#str_is)
- [str_plural](#str_plural)
- [str_random](#str_random)
- [str_singular](#str_singular)
- [str_slug](#str_slug)
- [studly_case](#studly_case)
- [ends_with](#endswith)
- [snake_case](#snakecase)
- [str_limit](#strlimit)
- [starts_with](#startswith)
- [str_contains](#strcontains)
- [str_finish](#strfinish)
- [str_is](#stris)
- [str_plural](#strplural)
- [str_random](#strrandom)
- [str_singular](#strsingular)
- [str_slug](#strslug)
- [studly_case](#studlycase)
- [trans](#trans)
- [trans_choice](#trans_choice)
- [trans_choice](#transchoice)

</div>

Expand Down Expand Up @@ -102,9 +103,9 @@ Miscellaneous
- [request](#request)
- [response](#response)
- [route](#route)
- [secure_asset](#secure_asset)
- [trace_log](#trace_log)
- [trace_sql](#trace_sql)
- [secure_asset](#secureasset)
- [trace_log](#tracelog)
- [trace_sql](#tracesql)
- [url](#url)

</div>
Expand Down

0 comments on commit 4d83149

Please sign in to comment.