<commit_before><?php

namespace App\Http\Controllers;

use App\Slide;
use Illuminate\Http\Request;

class SlideController extends Controller
{
    public function index()
    {
        return view('slides.index')
            ->with('slides', Slide::orderBy('id', 'desc')->get());
    }

    public function create()
    {
        return view('slides.form');
    }

    public function store(Request $request)
    {
        $request->validate(Slide::$rules);

        $slide = Slide::create($request->input());
        if ($request->hasFile('image')) {
            $slide
                ->addMediaFromRequest('image')
                ->toMediaCollection('image');
        }

        return redirect()
            ->route('slide.index')
            ->with('message', 'Carousel ' .$slide->name. ' bol vytvorený');
    }

    public function show(Slide $slide)
    {
        return view('slides.show')->with('slide', $slide);
    }

    public function edit(Slide $slide)
    {
        return view('slides.form')->with('slide', $slide);
    }

    public function update(Request $request, Slide $slide)
    {
        $request->validate(Slide::$rules);

        $slide->update($request->input());
        if ($request->hasFile('image')) {<commit_msg>Remove 'show' action from SlideController<commit_after><?php

namespace App\Http\Controllers;

use App\Slide;
use Illuminate\Http\Request;

class SlideController extends Controller
{
    public function index()
    {
        return view('slides.index')
            ->with('slides', Slide::orderBy('id', 'desc')->get());
    }

    public function create()
    {
        return view('slides.form');
    }

    public function store(Request $request)
    {
        $request->validate(Slide::$rules);

        $slide = Slide::create($request->input());
        if ($request->hasFile('image')) {
            $slide
                ->addMediaFromRequest('image')
                ->toMediaCollection('image');
        }

        return redirect()
            ->route('slide.index')
            ->with('message', 'Carousel ' .$slide->name. ' bol vytvorený');
    }

    public function edit(Slide $slide)
    {
        return view('slides.form')->with('slide', $slide);
    }

    public function update(Request $request, Slide $slide)
    {
        $request->validate(Slide::$rules);

        $slide->update($request->input());
        if ($request->hasFile('image')) {
{'fraction_non_alphanumeric': 0.16313823163138233, 'fraction_numerical': 0.0, 'mean_word_length': 2.3991537376586742, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5886905', 'n_tokens_mistral': 694, 'n_tokens_neox': 686, 'n_words': 133}