* * @version 1.0.0 */ class SkillController extends VueController { public function __construct() { return $this->vueRoot('admin.skills'); } public function index() { $q = request()->get('q'); $skills = Skill::orderBy('name', 'ASC') ->where('name', 'LIKE', "%{$q}%") ->with('department:id,name') ->paginate(config('app.pagination')); return $this->vuew('index', [ 'skills' => $skills, ]); } public function create() { $department = department::orderBy('name', 'ASC')->get(); return $this->vuew('create', [ 'departments' => $department, ]); } public function store(StoreSkill $request) { Skill::create($request->all()); return $this->index(); } public function update(UpdateSkill $request, Skill $skill) { $skill->update($request->all()); } public function destroy (Skill $skill) { $skill->delete(); } }