<?php

namespace App\Http\Controllers;

use App\Models\Resume;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\View\View;

class ResumeController extends Controller
{

    /**
     * Notes: 显示详情
     *
     * @Author: 玄尘
     * @Date: 2021/12/1 10:46
     * @param  \App\Models\Resume  $resume
     * @return Application|Factory|View
     */
    public function show(Resume $resume)
    {
        if ($resume->url) {
            return redirect()->away($resume->url);
        }
        $category = $resume->category;
        $parent   = $category;
        if ($category->childrens->isEmpty() && $category->parent) {
            $parent = $category->parent;
        }
        return view('resume.show', compact('resume', 'category', 'parent'));

    }


}
