Skip to content

Commit

Permalink
Merge pull request #1617 from fey/use-spatie-html
Browse files Browse the repository at this point in the history
Use spatie html
  • Loading branch information
fey authored Mar 14, 2024
2 parents 7fe0d05 + d2ac378 commit 47e812b
Show file tree
Hide file tree
Showing 39 changed files with 1,601 additions and 2,312 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/ExerciseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function index(): View

public function show(Exercise $exercise): View
{
$exercise->load('chapter', 'users');
$exercise->load('chapter', 'users', 'comments');
/** @var User $authUser */
$authUser = auth()->user() ?? new User();
$userCompletedExercise = $authUser->exerciseMembers()
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public function index(): View

$filter = Request::query('filter', '');
$statisticTable = $this->getStatisticTable($filter);
$logItems = Activity::latest()->has('subject')->has('causer')->with('causer')->limit(10)->get();
$logItems = Activity::latest()->has('subject')->has('causer')->with('causer', 'subject')->limit(10)->get();
$chart = ChartHelper::getChart();
$comments = Comment::latest()->has('user')->with('user')->with('commentable')->limit(10)->get();
$comments = Comment::latest()->has('user')->with('user')->with('commentable', 'user')->limit(10)->get();

return view('home.index', compact(
'logItems',
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Settings/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ public function update(Request $request): RedirectResponse
flash()->error(__('layout.flash.error'));
}

return redirect()->route('settings.profile.index', $user);
return redirect()->route('settings.profile.index');
}
}
2 changes: 1 addition & 1 deletion app/Models/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Comment extends Model

public string $defaultPresenter = CommentPresenter::class;

protected $with = ['user'];
protected $with = ['user', 'commentable', 'parent'];
protected $fillable = ['content', 'commentable_type', 'commentable_id', 'parent_id'];

public function user(): BelongsTo
Expand Down
5 changes: 5 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

namespace App\Providers;

use App;
use Illuminate\Support\ServiceProvider;
use Illuminate\Pagination\Paginator;
use URL;
use DB;
use Blade;
use Illuminate\Database\Eloquent\Model;

class AppServiceProvider extends ServiceProvider
{
Expand All @@ -32,6 +34,9 @@ public function register(): void
*/
public function boot(): void
{
Model::preventLazyLoading(
!App::isProduction()
);
Paginator::useBootstrap();
if (config('app.env') === 'production') {
URL::forceScheme('https');
Expand Down
37 changes: 22 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
{
"name": "hexlet/hexlet-sicp",
"type": "project",
"version": "1.0.0",
"description": "SICP book tracker",
"keywords": [
"hexlet",
"sicp",
"project"
],
"license": "MIT",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/fey/davidhemphill-presenter"
},
{
"type": "vcs",
"url": "https://github.com/atmonshi/Laravel-GitHub"
}
],
"require": {
"php": "^8.3.0",
"ext-bcmath": "*",
Expand All @@ -21,44 +32,40 @@
"ext-sqlite3": "*",
"ext-xml": "*",
"ext-zip": "*",
"browner12/helpers": "^3.5",
"dedoc/scramble": "^0.8.5",
"diglactic/laravel-breadcrumbs": "^v8.1.1",
"doctrine/dbal": "^3.7",
"browner12/helpers": "dev-master",
"dedoc/scramble": "^0.9",
"diglactic/laravel-breadcrumbs": "^v9.0",
"erusev/parsedown": "^1.7",
"fakerphp/faker": "^1.23",
"graham-campbell/github": "^v12.4.0",
"graham-campbell/github": "dev-laravel-11",
"guzzlehttp/guzzle": "^7.8",
"hemp/presenter": "^2.7",
"hemp/presenter": "dev-support-for-laravel-11",
"http-interop/http-factory-guzzle": "^1.2",
"iben12/laravel-statable": "^1.5",
"laminas/laminas-diactoros": "^3.3",
"laracasts/flash": "^3.2",
"laraeast/laravel-bootstrap-forms": "^5.4",
"laravel/framework": "^10.35",
"laravel/framework": "^11.0",
"laravel/helpers": "^1.7",
"laravel/legacy-factories": "^1.3",
"laravel/socialite": "^5.11",
"laravel/tinker": "^2.8",
"laravel/ui": "^v4.2.3",
"laravelcollective/html": "^6.4",
"mcamara/laravel-localization": "^1.8",
"mcamara/laravel-localization": "^2.0",
"mikehaertl/php-shellcommand": "^1.7",
"rollbar/rollbar-laravel": "^8.0",
"sebdesign/laravel-state-machine": "^3.4",
"spatie/laravel-activitylog": "^4.7.3",
"spatie/laravel-html": "^3.6",
"spatie/laravel-query-builder": "^5.6",
"spatie/laravel-sitemap": "^6.4",
"spatie/laravel-sitemap": "^7.2",
"symfony/yaml": "^6.4"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.9",
"barryvdh/laravel-ide-helper": "^2.13",
"beyondcode/laravel-dump-server": "^1.9",
"barryvdh/laravel-ide-helper": "^3.0",
"spatie/laravel-ignition": "^2.3",
"heroku/heroku-buildpack-php": "^231",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^7.10",
"nunomaduro/collision": "^8.0",
"larastan/larastan": "^2.7",
"phpunit/phpunit": "^10.5",
"roave/security-advisories": "dev-master",
Expand Down
Loading

0 comments on commit 47e812b

Please sign in to comment.