HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/fire-tech/fire-tech.nl/app/KommaApp/Clients/Composer/SubscribeComposer.php
<?php


namespace App\KommaApp\Clients\Composer;


use App\KommaApp\Courses\CourseService;
use Illuminate\View\View;

class SubscribeComposer
{

    private $courseService;

    public function __construct()
    {
        $this->courseService = new CourseService();
    }

    /**
     * Bind data to the view.
     *
     * @param  View $view
     * @return void
     */
    public function compose(View $view)
    {
        $dates = null;
        $course = null;
        $courseId = null;
        if (\Input::has('courseId')) {
            $courseId = \Input::get('courseId');
            $course = $this->courseService->getCourseById($courseId);
            $dates = $this->courseService->getDatesForCourse($courseId);
        } elseif(!empty(old('courseId'))) {
            $courseId = old('courseId');
            $course = $this->courseService->getCourseById($courseId);
            $dates = $this->courseService->getDatesForCourse($courseId);
        }
        $date = null;
        if (\Input::has('date')) {
            $date = trim(\Input::get('date'));
        } elseif(!empty(old('date'))) {
            $date = trim(old('date'));
        }
        $courses = $this->courseService->getAllCourses();

        $subscribe_step = null;
        if (\Input::has('step')) {
            $subscribe_step = \Input::get('step');
        } elseif(!empty(old('step'))) {
            $subscribe_step = old('step');
        }

        $view->with([
            'subscribe_step' => $subscribe_step,
            'courses' => $courses,
            'course' => $course,
            'dates' => $dates,
            'date' => $date]);
    }

}