Skip to content

Commit

Permalink
Merge branch 'release/5.2.5'
Browse files Browse the repository at this point in the history
* release/5.2.5:
  compiled assets
  updated the changelog
  added php7.4
  Apply fixes from StyleCI (#636)
  additional checks for #635
  Apply fixes from StyleCI (#632)
  refactored directory structure
  removed unnecessary font links and documented sass files
  compiled assets
  updated the readme
  changes canvas:setup to canvas:ui
  fixed the optional decimal
  compiled assets
  Apply fixes from StyleCI (#629)
  cleanup and refactor
  • Loading branch information
austintoddj committed Feb 24, 2020
2 parents c7fffaf + 455e4c0 commit bd45761
Show file tree
Hide file tree
Showing 59 changed files with 387 additions and 427 deletions.
76 changes: 14 additions & 62 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,11 @@ Now that the projects are linked, run the following installation steps:
```bash
php artisan canvas:install
php artisan storage:link
php artisan canvas:setup
php artisan canvas:ui
```

Statistics are a core component to the app, so it's best to have a large dataset in place when developing. To generate some, add the following snippets to your Laravel app:

In the `run()` method of the `DatabaseSeeder`:

```php
$this->call(CanvasTrackingDataSeeder::class);
```

Create a new class named `CanvasTrackingDataSeeder` and add this to the `run()` method:

```php
Expand All @@ -102,41 +96,23 @@ factory(\Canvas\View::class, 2500)->create();
factory(\Canvas\Visit::class, 2500)->create();
```

In the `run()` method of the `DatabaseSeeder`:

```php
$this->call(CanvasTrackingDataSeeder::class);
```

Create a new factory named `ViewFactory` and add this definition:

```php
$factory->define(\Canvas\View::class, function (\Faker\Generator $faker) {
$referers = collect([
'https://google.com',
'https://twitter.com',
'https://facebook.com',
'https://medium.com',
'https://laravel-news.com',
'https://reddit.com',
'https://wordpress.com',
'https://news.ycombinator.com',
'https://hackernoon.com',
'https://dev.to',
'https://www.sitepoint.com',
]);

$user_agents = collect([
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.2 Safari/605.1.15',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',

]);

$timestamp = today()->subDays(rand(0, 60))->toDateTimeString();

return [
'post_id' => \Canvas\Post::all()->pluck('id')->random(),
'ip' => $faker->ipv4,
'agent' => $user_agents->random(),
'referer' => $referers->random(),
'ip' => $faker->ipv4,
'agent' => $faker->userAgent,
'referer' => $faker->url,
'created_at' => $timestamp,
'updated_at' => $timestamp,
];
Expand All @@ -147,37 +123,13 @@ Create a new factory named `VisitFactory` and add this definition:

```php
$factory->define(\Canvas\Visit::class, function (\Faker\Generator $faker) {
$referers = collect([
'https://google.com',
'https://twitter.com',
'https://facebook.com',
'https://medium.com',
'https://laravel-news.com',
'https://reddit.com',
'https://wordpress.com',
'https://news.ycombinator.com',
'https://hackernoon.com',
'https://dev.to',
'https://www.sitepoint.com',
]);

$user_agents = collect([
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.2 Safari/605.1.15',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',

]);

$timestamp = today()->subDays(rand(0, 60))->toDateTimeString();

return [
'post_id' => \Canvas\Post::all()->pluck('id')->random(),
'ip' => $faker->ipv4,
'agent' => $user_agents->random(),
'referer' => $referers->random(),
'post_id' => \Canvas\Post::all()->pluck('id')->random(),
'ip' => $faker->ipv4,
'agent' => $faker->userAgent,
'referer' => $faker->url,
'created_at' => $timestamp,
'updated_at' => $timestamp,
];
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ matrix:
env: LARAVEL='6.*' TESTBENCH='4.*' DBAL='2.9.*'
- php: 7.3
env: LARAVEL='6.*' TESTBENCH='4.*' DBAL='2.9.*'
- php: 7.4
env: LARAVEL='6.*' TESTBENCH='4.*' DBAL='2.9.*'

before_install:
- phpenv config-rm xdebug.ini || true
Expand Down
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## [Unreleased](https://github.com/cnvs/canvas/compare/master...develop)

## [5.2.5](https://github.com/cnvs/canvas/compare/v5.2.4...v5.2.5) (February 24, 2020)

### Fixed
- Fix for a bad array offset when using PHP 7.4 ([#635](https://github.com/cnvs/canvas/issues/635))
- Fixed zero-decimals with an optional parameter ([33d1692](https://github.com/cnvs/canvas/commit/33d16924beb425b6157a9ec65d7fe7ee5a21d2d2))

### Changed
- Refactored the `canvas:setup` Artisan command ([0dfb717](https://github.com/cnvs/canvas/commit/0dfb717a832590bc1c133a9fb6f611fdbaf172b0))

## [5.2.4](https://github.com/cnvs/canvas/compare/v5.2.3...v5.2.4) (February 10, 2020)

### Fixed
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"php": ">=7.1",
"ext-json": "*",
"doctrine/dbal": "^2.6|^2.7|^2.8|^2.9|^2.10",
"illuminate/support": "^5.6|^5.7|^5.8|^6.0",
"spatie/laravel-blade-javascript": "^2.1|^2.2|^2.3|^2.4"
"illuminate/support": "^5.6|^5.7|^5.8|^6.0"
},
"require-dev": {
"mockery/mockery": "^1.1",
Expand Down
23 changes: 23 additions & 0 deletions database/factories/PostModelFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

/* @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(\Canvas\Post::class, function (Faker\Generator $faker) {
return [
'id' => $faker->uuid,
'slug' => $faker->slug,
'title' => $faker->word,
'summary' => $faker->sentence,
'body' => $faker->realText(),
'published_at' => today()->toDateTimeString(),
'featured_image' => $faker->imageUrl(),
'featured_image_caption' => $faker->sentence,
'user_id' => function () {
return factory(\Illuminate\Foundation\Auth\User::class)->create()->id;
},
'meta' => [
'title' => $faker->sentence,
'description' => $faker->sentence,
'canonical_link' => $faker->sentence,
],
];
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
/* @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(\Canvas\Tag::class, function (Faker\Generator $faker) {
return [
'id' => $faker->uuid,
'slug' => $faker->slug,
'name' => $faker->word,
'id' => $faker->uuid,
'slug' => $faker->slug,
'name' => $faker->word,
'user_id' => function () {
return factory(\Illuminate\Foundation\Auth\User::class)->create()->id;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
/* @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(\Canvas\Topic::class, function (Faker\Generator $faker) {
return [
'id' => $faker->uuid,
'slug' => $faker->slug,
'name' => $faker->word,
'id' => $faker->uuid,
'slug' => $faker->slug,
'name' => $faker->word,
'user_id' => function () {
return factory(\Illuminate\Foundation\Auth\User::class)->create()->id;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/* @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(\Illuminate\Foundation\Auth\User::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'email' => $faker->safeEmail,
'name' => $faker->name,
'email' => $faker->safeEmail,
'password' => bcrypt($faker->password),
];
});
13 changes: 13 additions & 0 deletions database/factories/ViewModelFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/* @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(\Canvas\View::class, function (Faker\Generator $faker) {
return [
'post_id' => function () {
return factory(\Canvas\Post::class)->create()->id;
},
'ip' => $faker->ipv4,
'agent' => $faker->userAgent,
'referer' => $faker->url,
];
});
13 changes: 13 additions & 0 deletions database/factories/VisitModelFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/* @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(\Canvas\Visit::class, function (Faker\Generator $faker) {
return [
'post_id' => function () {
return factory(\Canvas\Post::class)->create()->id;
},
'ip' => $faker->ipv4,
'agent' => $faker->userAgent,
'referer' => $faker->url,
];
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"axios": "^0.19.0",
"bootstrap": "^4.4.0",
"chart.js": "^2.9.3",
"cross-env": "^6.0",
"cross-env": "^7.0",
"filepond": "^4.9.5",
"filepond-plugin-file-validate-size": "^2.2.0",
"filepond-plugin-file-validate-type": "^1.2.4",
Expand Down
Loading

0 comments on commit bd45761

Please sign in to comment.