Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

my changes #398

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions app/Http/BaseControllers/AcademicSettingBaseController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

namespace App\Http\BaseControllers;

use App\Http\BaseControllers;
use Illuminate\Http\Request;
use App\Traits\SchoolSession;
use App\Interfaces\UserInterface;
use App\Interfaces\CourseInterface;
use App\Interfaces\SectionInterface;
use App\Interfaces\SemesterInterface;
use App\Interfaces\SchoolClassInterface;
use App\Interfaces\SchoolSessionInterface;
use App\Interfaces\AcademicSettingInterface;
use App\Http\Requests\AttendanceTypeUpdateRequest;

class AcademicSettingBaseController extends BaseControllers
{
use SchoolSession;
protected $academicSettingRepository;
protected $schoolSessionRepository;
protected $schoolClassRepository;
protected $schoolSectionRepository;
protected $userRepository;
protected $courseRepository;
protected $semesterRepository;

public function __construct(
AcademicSettingInterface $academicSettingRepository,
SchoolSessionInterface $schoolSessionRepository,
SchoolClassInterface $schoolClassRepository,
SectionInterface $schoolSectionRepository,
UserInterface $userRepository,
CourseInterface $courseRepository,
SemesterInterface $semesterRepository
) {
$this->academicSettingRepository = $academicSettingRepository;
$this->schoolSessionRepository = $schoolSessionRepository;
$this->schoolClassRepository = $schoolClassRepository;
$this->schoolSectionRepository = $schoolSectionRepository;
$this->userRepository = $userRepository;
$this->courseRepository = $courseRepository;
$this->semesterRepository = $semesterRepository;
}

/**
* Update the specified resource in storage.
*
* @param AttendanceTypeUpdateRequest $request
* @return \Illuminate\Http\Response
*/
public function updateAttendanceType(AttendanceTypeUpdateRequest $request)
{
try {
$this->academicSettingRepository->updateAttendanceType($request->validated());
} catch (\Exception $e) {
echo 'Caught Exception: ' . $e->getMessage();
}
}

public function updateFinalMarksSubmissionStatus(Request $request) {
try {
$this->academicSettingRepository->updateFinalMarksSubmissionStatus($request);
} catch (\Exception $e) {
echo 'Caught Exception: ' . $e->getMessage();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Controllers;
namespace App\Http\BaseControllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use Illuminate\Http\Request;
use App\Traits\SchoolSession;
use App\Interfaces\UserInterface;
Expand All @@ -14,16 +14,9 @@
use App\Interfaces\AcademicSettingInterface;
use App\Http\Requests\AttendanceTypeUpdateRequest;

class AcademicSettingController extends Controller
class AcademicSettingController extends BaseController
{
use SchoolSession;
protected $academicSettingRepository;
protected $schoolSessionRepository;
protected $schoolClassRepository;
protected $schoolSectionRepository;
protected $userRepository;
protected $courseRepository;
protected $semesterRepository;

public function __construct(
AcademicSettingInterface $academicSettingRepository,
Expand All @@ -34,15 +27,17 @@ public function __construct(
CourseInterface $courseRepository,
SemesterInterface $semesterRepository
) {
parent::__construct(
$academicSettingRepository,
$schoolSessionRepository,
$schoolClassRepository,
$schoolSectionRepository,
$userRepository,
$courseRepository,
$semesterRepository
);
$this->middleware(['can:view academic settings']);

$this->academicSettingRepository = $academicSettingRepository;
$this->schoolSessionRepository = $schoolSessionRepository;
$this->schoolClassRepository = $schoolClassRepository;
$this->schoolSectionRepository = $schoolSectionRepository;
$this->userRepository = $userRepository;
$this->courseRepository = $courseRepository;
$this->semesterRepository = $semesterRepository;
}

/**
Expand Down Expand Up @@ -94,7 +89,7 @@ public function index()
public function updateAttendanceType(AttendanceTypeUpdateRequest $request)
{
try {
$this->academicSettingRepository->updateAttendanceType($request->validated());
parent::updateAttendanceType($request);

return back()->with('status', 'Attendance type update was successful!');
} catch (\Exception $e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use Illuminate\Http\Request;
use App\Traits\SchoolSession;
use App\Interfaces\SemesterInterface;
use App\Interfaces\SchoolSessionInterface;
use App\Http\Requests\TeacherAssignRequest;
use App\Repositories\AssignedTeacherRepository;

class AssignedTeacherController extends Controller
class AssignedTeacherController extends BaseControllers
{
use SchoolSession;
protected $schoolSessionRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Models\Assignment;
use Illuminate\Http\Request;
use App\Traits\SchoolSession;
use App\Http\Requests\StoreFileRequest;
use App\Interfaces\SchoolSessionInterface;
use App\Repositories\AssignmentRepository;

class AssignmentController extends Controller
class AssignmentController extends BaseControllers
{
use SchoolSession;
protected $schoolSessionRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Models\Attendance;
use Illuminate\Http\Request;
use App\Interfaces\UserInterface;
Expand All @@ -15,7 +15,7 @@
use App\Repositories\CourseRepository;
use App\Traits\SchoolSession;

class AttendanceController extends Controller
class AttendanceController extends BaseControllers
{
use SchoolSession;
protected $academicSettingRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ConfirmsPasswords;

class ConfirmPasswordController extends Controller
class ConfirmPasswordController extends BaseControllers
{
/*
|--------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;

class ForgotPasswordController extends Controller
class ForgotPasswordController extends BaseControllers
{
/*
|--------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
class LoginController extends BaseControllers
{
/*
|--------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Providers\RouteServiceProvider;
use App\Models\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;

class RegisterController extends Controller
class RegisterController extends BaseControllers
{
/*
|--------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ResetsPasswords;

class ResetPasswordController extends Controller
class ResetPasswordController extends BaseControllers
{
/*
|--------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace App\Http\Controllers\Auth;

use App\Interfaces\UserInterface;
use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use Illuminate\Support\Facades\Hash;
use App\Http\Requests\PasswordChangeRequest;

class UpdatePasswordController extends Controller
class UpdatePasswordController extends BaseControllers
{
protected $userRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\VerifiesEmails;

class VerificationController extends Controller
class VerificationController extends BaseControllers
{
/*
|--------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Models\Course;
use Illuminate\Http\Request;
use App\Traits\SchoolSession;
Expand All @@ -11,7 +11,7 @@
use App\Interfaces\SchoolSessionInterface;
use App\Repositories\PromotionRepository;

class CourseController extends Controller
class CourseController extends BaseControllers
{
use SchoolSession;
protected $schoolCourseRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Models\Event;
use Illuminate\Http\Request;
use App\Traits\SchoolSession;
use App\Interfaces\SchoolSessionInterface;

class EventController extends Controller
class EventController extends BaseControllers
{
use SchoolSession;
protected $schoolSessionRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Http\Requests\ExamStoreRequest;
use App\Models\Exam;
use Illuminate\Http\Request;
Expand All @@ -13,7 +13,7 @@
use App\Repositories\AssignedTeacherRepository;
use App\Repositories\ExamRepository;

class ExamController extends Controller
class ExamController extends BaseControllers
{
use SchoolSession;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Http\Requests\ExamRuleStoreRequest;
use App\Models\ExamRule;
use Illuminate\Http\Request;
use App\Traits\SchoolSession;
use App\Repositories\ExamRuleRepository;
use App\Interfaces\SchoolSessionInterface;

class ExamRuleController extends Controller
class ExamRuleController extends BaseControllers
{
use SchoolSession;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use App\Models\GradeRule;
use Illuminate\Http\Request;
use App\Traits\SchoolSession;
use App\Repositories\GradeRuleRepository;
use App\Interfaces\SchoolSessionInterface;
use App\Http\Requests\GradeRuleStoreRequest;

class GradeRuleController extends Controller
class GradeRuleController extends BaseControllers
{
use SchoolSession;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\BaseControllers;
use Illuminate\Http\Request;
use App\Models\GradingSystem;
use App\Traits\SchoolSession;
Expand All @@ -12,7 +12,7 @@
use App\Http\Requests\GradingSystemStoreRequest;
use App\Repositories\GradingSystemRepository;

class GradingSystemController extends Controller
class GradingSystemController extends BaseControllers
{
use SchoolSession;

Expand Down
Loading