1 개요

라라벨 컨트롤러 예제 UserController

<?php
namespace App\\Http\\Controllers;

use App\\User;
use App\\Http\\Controllers\\Controller;

class UserController extends Controller
{
    public function list()
    {
        return view('user.list')->with('list', User::findAll());
    }

    public function showProfile($id)
    {
        return view('user.profile', ['user' => User::findOrFail($id)]);
    }

    public function delete($id)
    {
        User::delete($id);
        return view('user.delete');
    }
}