diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php new file mode 100644 index 0000000..963ba9a --- /dev/null +++ b/app/Http/Controllers/ProjectController.php @@ -0,0 +1,77 @@ +title('Projects - '.config('app.name')); + $projects = Project::active()->orderByDesc('start_date')->paginate(12); + return view('projects.index', compact('projects')); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + // + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request) + { + // + } + + public function show($param): View + { + $project = Project::where('uuid', $param) + ->orWhere('slug', $param) + ->active() + ->firstOrFail(); + abort_if(! $project, 404); + views($project)->cooldown(60)->record(); + + seo()->title($project->title.' - Projects - '.config('app.name')); + seo()->description(strip_tags(Str::of(Str::limit($project->content, 150))->markdown())); + + return view('project.show', compact('project')); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(string $id) + { + // + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, string $id) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(string $id) + { + // + } +} diff --git a/resources/views/layouts/guest.blade.php b/resources/views/layouts/guest.blade.php index 887227d..baf3cdc 100644 --- a/resources/views/layouts/guest.blade.php +++ b/resources/views/layouts/guest.blade.php @@ -43,6 +43,7 @@
+ {{ read_time($project->content)}} · {{ App\Helpers\NumberHelper::nearestK(views($project)->count()) }} {{ Str::plural('view', views($project)->count()) }} · {{ $project->likes_count }} {{ Str::plural('like', $project->likes_count) }} + {{--@foreach ($post->tags as $tag) + {{ $tag->name }} + @endforeach--}} +
+ + @if (now()->subYears(1) > $project->created_at) +{{ __('Note: This article was published over a year ago. Information within may have changed since then. While efforts are made to keep content current, please verify critical details before making decisions based on this information.') }}
+