├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .styleci.yml ├── README.md ├── app ├── Attendance.php ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Grade.php ├── Http │ ├── Controllers │ │ ├── AttendanceController.php │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ ├── ResetPasswordController.php │ │ │ └── VerificationController.php │ │ ├── Controller.php │ │ ├── DashboardController.php │ │ ├── GradeController.php │ │ ├── HomeController.php │ │ ├── ParentsController.php │ │ ├── RoleAssign.php │ │ ├── RolePermissionController.php │ │ ├── StudentController.php │ │ ├── SubjectController.php │ │ └── TeacherController.php │ ├── Kernel.php │ └── Middleware │ │ ├── Authenticate.php │ │ ├── CheckForMaintenanceMode.php │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php ├── Parents.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Student.php ├── Subject.php ├── Teacher.php └── User.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── database.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── permission.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2019_05_14_114748_create_permission_tables.php │ ├── 2019_05_15_180937_create_students_table.php │ ├── 2019_05_15_181154_create_parents_table.php │ ├── 2019_05_15_181254_create_teachers_table.php │ ├── 2019_05_15_181552_create_grades_table.php │ ├── 2019_05_16_174745_create_subjects_table.php │ ├── 2019_05_16_175620_create_grade_subject_table.php │ └── 2019_05_17_133226_create_attendances_table.php └── seeds │ ├── DatabaseSeeder.php │ └── RolesAndPermissionsSeeder.php ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── css │ ├── app.css │ └── images │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ ├── ui-icons_444444_256x240.png │ │ ├── ui-icons_555555_256x240.png │ │ ├── ui-icons_777620_256x240.png │ │ ├── ui-icons_777777_256x240.png │ │ ├── ui-icons_cc0000_256x240.png │ │ └── ui-icons_ffffff_256x240.png ├── favicon.ico ├── images │ └── profile │ │ ├── admin-1.png │ │ ├── avatar.png │ │ └── teacher-2.png ├── index.php ├── js │ └── app.js ├── mix-manifest.json ├── robots.txt └── web.config ├── resources ├── js │ ├── app.js │ ├── bootstrap.js │ └── components │ │ └── ExampleComponent.vue ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php ├── sass │ └── app.scss └── views │ ├── auth │ ├── login.blade.php │ ├── passwords │ │ ├── email.blade.php │ │ └── reset.blade.php │ ├── register.blade.php │ └── verify.blade.php │ ├── backend │ ├── assignrole │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ ├── attendance │ │ ├── create.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── classes │ │ ├── assign-subject.blade.php │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ ├── modals │ │ └── delete.blade.php │ ├── parents │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ ├── permissions │ │ ├── create.blade.php │ │ └── edit.blade.php │ ├── roles │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ ├── students │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── subjects │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ └── teachers │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ ├── dashboard │ ├── admin.blade.php │ ├── parents.blade.php │ ├── student.blade.php │ └── teacher.blade.php │ ├── errors │ ├── 403.blade.php │ └── 404.blade.php │ ├── home.blade.php │ ├── layouts │ ├── app.blade.php │ ├── frontend.blade.php │ ├── navbar.blade.php │ └── sidebar.blade.php │ ├── profile │ ├── changepassword.blade.php │ ├── edit.blade.php │ └── index.blade.php │ ├── vendor │ └── pagination │ │ ├── bootstrap-4.blade.php │ │ ├── default.blade.php │ │ ├── semantic-ui.blade.php │ │ ├── simple-bootstrap-4.blade.php │ │ └── simple-default.blade.php │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tailwind.config.js ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php ├── v8-compile-cache-0 └── 6.2.414.50 │ ├── zSvarzSwwwzSschool-management-systemzSnode_moduleszSwebpack-clizSbinzScli.js.BLOB │ └── zSvarzSwwwzSschool-management-systemzSnode_moduleszSwebpack-clizSbinzScli.js.MAP └── webpack.mix.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.yml] 15 | indent_size = 2 16 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=127.0.0.1 11 | DB_PORT=3306 12 | DB_DATABASE=homestead 13 | DB_USERNAME=homestead 14 | DB_PASSWORD=secret 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | QUEUE_CONNECTION=sync 19 | SESSION_DRIVER=file 20 | SESSION_LIFETIME=120 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_DRIVER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | 33 | AWS_ACCESS_KEY_ID= 34 | AWS_SECRET_ACCESS_KEY= 35 | AWS_DEFAULT_REGION=us-east-1 36 | AWS_BUCKET= 37 | 38 | PUSHER_APP_ID= 39 | PUSHER_APP_KEY= 40 | PUSHER_APP_SECRET= 41 | PUSHER_APP_CLUSTER=mt1 42 | 43 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 44 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 45 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | .env 7 | .phpunit.result.cache 8 | Homestead.json 9 | Homestead.yaml 10 | npm-debug.log 11 | yarn-error.log 12 | /public/images/profile/!avatar.png 13 | /public/images/profile/*.png 14 | /public/images/profile/*.jpg 15 | /public/images/profile/*.jpeg 16 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | preset: laravel 3 | disabled: 4 | - unused_use 5 | finder: 6 | not-name: 7 | - index.php 8 | - server.php 9 | js: 10 | finder: 11 | not-name: 12 | - webpack.mix.js 13 | css: true 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Laravel School Management System (LSMS) 2 | 3 | **LSM System** is a simple role based school management system. 4 | 5 | ### Installation 6 | 01. `git clone https://github.com/parvez-git/laravel-school-management-system.git` 7 | 02. `cd laravel-school-management-system` 8 | 03. `composer install` 9 | 04. `npm install` 10 | 05. `cp .env.example .env` 11 | 06. `php artisan key:generate` 12 | 07. `php artisan migrate` 13 | 08. `php artisan db:seed` 14 | 09. `php artisan serve` 15 | 16 | ### Packages 17 | 01. `spatie/laravel-permission` 18 | 19 | ### Credentials 20 | 21 | To test application the database is seeding with users : 22 | 23 | - Admin : email = admin@demo.com, password = 12345678 and Role: Admin 24 | - Teacher : email = teacher@demo.com, password = 12345678 and Role: Teacher 25 | - Parent : email = parent@demo.com, password = 12345678 and Role: Parent 26 | - Student : email = student@demo.com, password = 12345678 and Role: Student 27 | -------------------------------------------------------------------------------- /app/Attendance.php: -------------------------------------------------------------------------------- 1 | belongsTo(Student::class); 19 | } 20 | 21 | public function teacher() { 22 | return $this->belongsTo(Teacher::class); 23 | } 24 | 25 | public function class() { 26 | return $this->belongsTo(Grade::class); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | $this->load(__DIR__.'/Commands'); 39 | 40 | require base_path('routes/console.php'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | hasMany(Student::class,'class_id'); 19 | } 20 | 21 | public function subjects() 22 | { 23 | return $this->belongsToMany(Subject::class); 24 | } 25 | 26 | public function teacher() 27 | { 28 | return $this->belongsTo(Teacher::class); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 41 | } 42 | 43 | /** 44 | * Get a validator for an incoming registration request. 45 | * 46 | * @param array $data 47 | * @return \Illuminate\Contracts\Validation\Validator 48 | */ 49 | protected function validator(array $data) 50 | { 51 | return Validator::make($data, [ 52 | 'name' => ['required', 'string', 'max:255'], 53 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 54 | 'password' => ['required', 'string', 'min:8', 'confirmed'], 55 | ]); 56 | } 57 | 58 | /** 59 | * Create a new user instance after a valid registration. 60 | * 61 | * @param array $data 62 | * @return \App\User 63 | */ 64 | protected function create(array $data) 65 | { 66 | return User::create([ 67 | 'name' => $data['name'], 68 | 'email' => $data['email'], 69 | 'password' => Hash::make($data['password']), 70 | ]); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/VerificationController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 38 | $this->middleware('signed')->only('verify'); 39 | $this->middleware('throttle:6,1')->only('verify', 'resend'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | latest()->paginate(10); 20 | 21 | return view('backend.classes.index', compact('classes')); 22 | } 23 | 24 | /** 25 | * Show the form for creating a new resource. 26 | * 27 | * @return \Illuminate\Http\Response 28 | */ 29 | public function create() 30 | { 31 | $teachers = Teacher::latest()->get(); 32 | 33 | return view('backend.classes.create', compact('teachers')); 34 | } 35 | 36 | /** 37 | * Store a newly created resource in storage. 38 | * 39 | * @param \Illuminate\Http\Request $request 40 | * @return \Illuminate\Http\Response 41 | */ 42 | public function store(Request $request) 43 | { 44 | $request->validate([ 45 | 'class_name' => 'required|string|max:255|unique:grades', 46 | 'class_numeric' => 'required|numeric', 47 | 'teacher_id' => 'required|numeric', 48 | 'class_description' => 'required|string|max:255' 49 | ]); 50 | 51 | Grade::create([ 52 | 'class_name' => $request->class_name, 53 | 'class_numeric' => $request->class_numeric, 54 | 'teacher_id' => $request->teacher_id, 55 | 'class_description' => $request->class_description 56 | ]); 57 | 58 | return redirect()->route('classes.index'); 59 | } 60 | 61 | /** 62 | * Display the specified resource. 63 | * 64 | * @param \App\Grade $grade 65 | * @return \Illuminate\Http\Response 66 | */ 67 | public function show(Grade $grade) 68 | { 69 | // 70 | } 71 | 72 | /** 73 | * Show the form for editing the specified resource. 74 | * 75 | * @param \App\Grade $grade 76 | * @return \Illuminate\Http\Response 77 | */ 78 | public function edit($id) 79 | { 80 | $teachers = Teacher::latest()->get(); 81 | $class = Grade::findOrFail($id); 82 | 83 | return view('backend.classes.edit', compact('class','teachers')); 84 | } 85 | 86 | /** 87 | * Update the specified resource in storage. 88 | * 89 | * @param \Illuminate\Http\Request $request 90 | * @param \App\Grade $grade 91 | * @return \Illuminate\Http\Response 92 | */ 93 | public function update(Request $request, $id) 94 | { 95 | $request->validate([ 96 | 'class_name' => 'required|string|max:255|unique:grades,class_name,'.$id, 97 | 'class_numeric' => 'required|numeric', 98 | 'teacher_id' => 'required|numeric', 99 | 'class_description' => 'required|string|max:255' 100 | ]); 101 | 102 | $class = Grade::findOrFail($id); 103 | 104 | $class->update([ 105 | 'class_name' => $request->class_name, 106 | 'class_numeric' => $request->class_numeric, 107 | 'teacher_id' => $request->teacher_id, 108 | 'class_description' => $request->class_description 109 | ]); 110 | 111 | return redirect()->route('classes.index'); 112 | } 113 | 114 | /** 115 | * Remove the specified resource from storage. 116 | * 117 | * @param \App\Grade $grade 118 | * @return \Illuminate\Http\Response 119 | */ 120 | public function destroy($id) 121 | { 122 | $class = Grade::findOrFail($id); 123 | 124 | $class->subjects()->detach(); 125 | $class->delete(); 126 | 127 | return back(); 128 | } 129 | 130 | /* 131 | * Assign Subjects to Grade 132 | * 133 | * @return \Illuminate\Http\Response 134 | */ 135 | public function assignSubject($classid) 136 | { 137 | $subjects = Subject::latest()->get(); 138 | $assigned = Grade::with(['subjects','students'])->findOrFail($classid); 139 | 140 | return view('backend.classes.assign-subject', compact('classid','subjects','assigned')); 141 | } 142 | 143 | /* 144 | * Add Assigned Subjects to Grade 145 | * 146 | * @param \Illuminate\Http\Request $request 147 | * @return \Illuminate\Http\Response 148 | */ 149 | public function storeAssignedSubject(Request $request, $id) 150 | { 151 | $class = Grade::findOrFail($id); 152 | 153 | $class->subjects()->sync($request->selectedsubjects); 154 | 155 | return redirect()->route('classes.index'); 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 23 | } 24 | 25 | /** 26 | * Show the application dashboard. 27 | * 28 | * @return \Illuminate\Contracts\Support\Renderable 29 | */ 30 | public function index() 31 | { 32 | $user = Auth::user(); 33 | 34 | if ($user->hasRole('Admin')) { 35 | 36 | $parents = Parents::latest()->get(); 37 | $teachers = Teacher::latest()->get(); 38 | $students = Student::latest()->get(); 39 | 40 | return view('home', compact('parents','teachers','students')); 41 | 42 | } elseif ($user->hasRole('Teacher')) { 43 | 44 | $teacher = Teacher::with(['user','subjects','classes','students'])->withCount('subjects','classes')->findOrFail($user->teacher->id); 45 | 46 | return view('home', compact('teacher')); 47 | 48 | } elseif ($user->hasRole('Parent')) { 49 | 50 | $parents = Parents::with(['children'])->withCount('children')->findOrFail($user->parent->id); 51 | 52 | return view('home', compact('parents')); 53 | 54 | } elseif ($user->hasRole('Student')) { 55 | 56 | $student = Student::with(['user','parent','class','attendances'])->findOrFail($user->student->id); 57 | 58 | return view('home', compact('student')); 59 | 60 | } else { 61 | return 'NO ROLE ASSIGNED YET!'; 62 | } 63 | 64 | } 65 | 66 | /** 67 | * PROFILE 68 | */ 69 | public function profile() 70 | { 71 | return view('profile.index'); 72 | } 73 | 74 | public function profileEdit() 75 | { 76 | return view('profile.edit'); 77 | } 78 | 79 | public function profileUpdate(Request $request) 80 | { 81 | $request->validate([ 82 | 'name' => 'required|string|max:255', 83 | 'email' => 'required|string|email|max:255|unique:users,email,'.auth()->id() 84 | ]); 85 | 86 | if ($request->hasFile('profile_picture')) { 87 | $profile = str_slug(auth()->user()->name).'-'.auth()->id().'.'.$request->profile_picture->getClientOriginalExtension(); 88 | $request->profile_picture->move(public_path('images/profile'), $profile); 89 | } else { 90 | $profile = 'avatar.png'; 91 | } 92 | 93 | $user = auth()->user(); 94 | 95 | $user->update([ 96 | 'name' => $request->name, 97 | 'email' => $request->email, 98 | 'profile_picture' => $profile 99 | ]); 100 | 101 | return redirect()->route('profile'); 102 | } 103 | 104 | /** 105 | * CHANGE PASSWORD 106 | */ 107 | public function changePasswordForm() 108 | { 109 | return view('profile.changepassword'); 110 | } 111 | 112 | public function changePassword(Request $request) 113 | { 114 | if (!(Hash::check($request->get('currentpassword'), Auth::user()->password))) { 115 | return back()->with([ 116 | 'msg_currentpassword' => 'Your current password does not matches with the password you provided! Please try again.' 117 | ]); 118 | } 119 | if(strcmp($request->get('currentpassword'), $request->get('newpassword')) == 0){ 120 | return back()->with([ 121 | 'msg_currentpassword' => 'New Password cannot be same as your current password! Please choose a different password.' 122 | ]); 123 | } 124 | 125 | $this->validate($request, [ 126 | 'currentpassword' => 'required', 127 | 'newpassword' => 'required|string|min:8|confirmed', 128 | ]); 129 | 130 | $user = Auth::user(); 131 | 132 | $user->password = bcrypt($request->get('newpassword')); 133 | $user->save(); 134 | 135 | Auth::logout(); 136 | return redirect()->route('login'); 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /app/Http/Controllers/RoleAssign.php: -------------------------------------------------------------------------------- 1 | latest()->paginate(10); 16 | 17 | return view('backend.assignrole.index', compact('users')); 18 | } 19 | 20 | public function create() 21 | { 22 | $roles = Role::latest()->get(); 23 | 24 | return view('backend.assignrole.create', compact('roles')); 25 | } 26 | 27 | public function store(Request $request) 28 | { 29 | $request->validate([ 30 | 'name' => 'required|string|max:255', 31 | 'email' => 'required|string|email|max:255|unique:users', 32 | 'password' => 'required|string|min:8', 33 | ]); 34 | 35 | $user = User::create([ 36 | 'name' => $request->name, 37 | 'email' => $request->email, 38 | 'password' => Hash::make($request->password) 39 | ]); 40 | 41 | $user->assignRole($request->role); 42 | 43 | return redirect()->route('assignrole.index'); 44 | } 45 | 46 | public function edit($id) 47 | { 48 | $user = User::with('roles')->findOrFail($id); 49 | $roles = Role::latest()->get(); 50 | 51 | return view('backend.assignrole.edit', compact('user','roles')); 52 | } 53 | 54 | public function update(Request $request, $id) 55 | { 56 | $request->validate([ 57 | 'name' => 'required|string|max:255', 58 | 'email' => 'required|string|email|max:255|unique:users,email,'.$id 59 | ]); 60 | 61 | $user = User::findOrFail($id); 62 | 63 | $user->update([ 64 | 'name' => $request->name, 65 | 'email' => $request->email 66 | ]); 67 | 68 | $user->syncRoles($request->selectedrole); 69 | 70 | return redirect()->route('assignrole.index'); 71 | } 72 | 73 | // NOT DONE 74 | public function destroy($id) 75 | { 76 | $user = User::findOrFail($id); 77 | 78 | // $user->removeRole('writer'); 79 | // $user->syncRoles(['writer', 'admin']); 80 | 81 | // if ($user->delete()) { 82 | 83 | // if($user->profile_picture != 'avatar.png') { 84 | 85 | // $image_path = public_path() . '/images/profile/' . $user->profile_picture; 86 | 87 | // if (is_file($image_path) && file_exists($image_path)) { 88 | 89 | // unlink($image_path); 90 | // } 91 | // } 92 | 93 | // } 94 | 95 | return back(); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /app/Http/Controllers/RolePermissionController.php: -------------------------------------------------------------------------------- 1 | get(); 17 | 18 | return view('backend.roles.index', compact('roles')); 19 | } 20 | 21 | public function createRole() 22 | { 23 | $permissions = Permission::latest()->get(); 24 | 25 | return view('backend.roles.create', compact('permissions')); 26 | } 27 | 28 | public function storeRole(Request $request) 29 | { 30 | $request->validate([ 31 | 'name' => 'required|string|max:255|unique:roles' 32 | ]); 33 | 34 | $role = Role::create(['name' => $request->name]); 35 | $role->givePermissionTo($request->selectedpermissions); 36 | 37 | return redirect()->route('roles-permissions'); 38 | 39 | } 40 | 41 | public function editRole($id) 42 | { 43 | $role = Role::with('permissions')->find($id); 44 | $permissions = Permission::latest()->get(); 45 | 46 | return view('backend.roles.edit', compact('role','permissions')); 47 | } 48 | 49 | public function updateRole(Request $request, $id) 50 | { 51 | $request->validate([ 52 | 'name' => 'required|string|max:255|unique:roles,name,'.$id 53 | ]); 54 | 55 | $role = Role::findById($id); 56 | $role->update(['name' => $request->name]); 57 | $role->syncPermissions($request->selectedpermissions); 58 | 59 | return redirect()->route('roles-permissions'); 60 | } 61 | 62 | /** 63 | * PERMISSIONS CRUD 64 | */ 65 | public function createPermission() 66 | { 67 | $roles = Role::latest()->get(); 68 | $permissions = Permission::latest()->get(); 69 | 70 | return view('backend.permissions.create', compact('roles','permissions')); 71 | } 72 | 73 | public function storePermission(Request $request) 74 | { 75 | $request->validate([ 76 | 'name' => 'required|string|max:255|unique:permissions' 77 | ]); 78 | 79 | $permission = Permission::create(['name' => $request->name]); 80 | $permission->assignRole($request->selectedroles); 81 | 82 | $roles = Role::latest()->get(); 83 | $permissions = Permission::latest()->get(); 84 | 85 | return view('backend.permissions.create', compact('roles','permissions')); 86 | } 87 | 88 | public function editPermission($id) 89 | { 90 | $permission = Permission::with('roles')->find($id); 91 | $roles = Role::latest()->get(); 92 | 93 | return view('backend.permissions.edit', compact('roles','permission')); 94 | } 95 | 96 | public function updatePermission(Request $request, $id) 97 | { 98 | $request->validate([ 99 | 'name' => 'required|string|max:255|unique:permissions,name,'.$id 100 | ]); 101 | 102 | $permission = Permission::findById($id); 103 | $permission->update(['name' => $request->name]); 104 | $permission->syncRoles($request->selectedroles); 105 | 106 | return redirect()->route('roles-permissions'); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /app/Http/Controllers/SubjectController.php: -------------------------------------------------------------------------------- 1 | latest()->paginate(10); 19 | 20 | return view('backend.subjects.index', compact('subjects')); 21 | } 22 | 23 | /** 24 | * Show the form for creating a new resource. 25 | * 26 | * @return \Illuminate\Http\Response 27 | */ 28 | public function create() 29 | { 30 | $teachers = Teacher::latest()->get(); 31 | 32 | return view('backend.subjects.create', compact('teachers')); 33 | } 34 | 35 | /** 36 | * Store a newly created resource in storage. 37 | * 38 | * @param \Illuminate\Http\Request $request 39 | * @return \Illuminate\Http\Response 40 | */ 41 | public function store(Request $request) 42 | { 43 | $request->validate([ 44 | 'name' => 'required|string|max:255|unique:subjects', 45 | 'subject_code' => 'required|numeric', 46 | 'teacher_id' => 'required|numeric', 47 | 'description' => 'required|string|max:255' 48 | ]); 49 | 50 | Subject::create([ 51 | 'name' => $request->name, 52 | 'slug' => str_slug($request->name), 53 | 'subject_code' => $request->subject_code, 54 | 'teacher_id' => $request->teacher_id, 55 | 'description' => $request->description 56 | ]); 57 | 58 | return redirect()->route('subject.index'); 59 | } 60 | 61 | /** 62 | * Display the specified resource. 63 | * 64 | * @param \App\Subject $subject 65 | * @return \Illuminate\Http\Response 66 | */ 67 | public function show(Subject $subject) 68 | { 69 | // 70 | } 71 | 72 | /** 73 | * Show the form for editing the specified resource. 74 | * 75 | * @param \App\Subject $subject 76 | * @return \Illuminate\Http\Response 77 | */ 78 | public function edit(Subject $subject) 79 | { 80 | $teachers = Teacher::latest()->get(); 81 | 82 | return view('backend.subjects.edit', compact('subject','teachers')); 83 | } 84 | 85 | /** 86 | * Update the specified resource in storage. 87 | * 88 | * @param \Illuminate\Http\Request $request 89 | * @param \App\Subject $subject 90 | * @return \Illuminate\Http\Response 91 | */ 92 | public function update(Request $request, Subject $subject) 93 | { 94 | $request->validate([ 95 | 'name' => 'required|string|max:255|unique:subjects,name,'.$subject->id, 96 | 'subject_code' => 'required|numeric', 97 | 'teacher_id' => 'required|numeric', 98 | 'description' => 'required|string|max:255' 99 | ]); 100 | 101 | $subject->update([ 102 | 'name' => $request->name, 103 | 'slug' => str_slug($request->name), 104 | 'subject_code' => $request->subject_code, 105 | 'teacher_id' => $request->teacher_id, 106 | 'description' => $request->description 107 | ]); 108 | 109 | return redirect()->route('subject.index'); 110 | } 111 | 112 | /** 113 | * Remove the specified resource from storage. 114 | * 115 | * @param \App\Subject $subject 116 | * @return \Illuminate\Http\Response 117 | */ 118 | public function destroy(Subject $subject) 119 | { 120 | $subject->delete(); 121 | 122 | return back(); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 31 | \App\Http\Middleware\EncryptCookies::class, 32 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 33 | \Illuminate\Session\Middleware\StartSession::class, 34 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 35 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 36 | \App\Http\Middleware\VerifyCsrfToken::class, 37 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 38 | ], 39 | 40 | 'api' => [ 41 | 'throttle:60,1', 42 | 'bindings', 43 | ], 44 | ]; 45 | 46 | /** 47 | * The application's route middleware. 48 | * 49 | * These middleware may be assigned to groups or used individually. 50 | * 51 | * @var array 52 | */ 53 | protected $routeMiddleware = [ 54 | 'auth' => \App\Http\Middleware\Authenticate::class, 55 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 56 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 57 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 58 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 59 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 60 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 61 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 62 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 63 | 'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class, 64 | 'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class, 65 | 'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class, 66 | ]; 67 | 68 | /** 69 | * The priority-sorted list of middleware. 70 | * 71 | * This forces non-global middleware to always be in the given order. 72 | * 73 | * @var array 74 | */ 75 | protected $middlewarePriority = [ 76 | \Illuminate\Session\Middleware\StartSession::class, 77 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 78 | \App\Http\Middleware\Authenticate::class, 79 | \Illuminate\Session\Middleware\AuthenticateSession::class, 80 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 81 | \Illuminate\Auth\Middleware\Authorize::class, 82 | ]; 83 | } 84 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/CheckForMaintenanceMode.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 22 | } 23 | 24 | public function children() 25 | { 26 | return $this->hasMany(Student::class, 'parent_id'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | parent::boot(); 31 | 32 | // 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::middleware('web') 55 | ->namespace($this->namespace) 56 | ->group(base_path('routes/web.php')); 57 | } 58 | 59 | /** 60 | * Define the "api" routes for the application. 61 | * 62 | * These routes are typically stateless. 63 | * 64 | * @return void 65 | */ 66 | protected function mapApiRoutes() 67 | { 68 | Route::prefix('api') 69 | ->middleware('api') 70 | ->namespace($this->namespace) 71 | ->group(base_path('routes/api.php')); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/Student.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 24 | } 25 | 26 | public function parent() 27 | { 28 | return $this->belongsTo(Parents::class); 29 | } 30 | 31 | public function class() 32 | { 33 | return $this->belongsTo(Grade::class, 'class_id'); 34 | } 35 | 36 | public function attendances() 37 | { 38 | return $this->hasMany(Attendance::class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Subject.php: -------------------------------------------------------------------------------- 1 | belongsTo(Teacher::class); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Teacher.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 21 | } 22 | 23 | public function subjects() 24 | { 25 | return $this->hasMany(Subject::class); 26 | } 27 | 28 | public function classes() 29 | { 30 | return $this->hasMany(Grade::class); 31 | } 32 | 33 | public function students() 34 | { 35 | return $this->classes()->withCount('students'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | 'datetime', 40 | ]; 41 | 42 | public function teacher() 43 | { 44 | return $this->hasOne(Teacher::class); 45 | } 46 | 47 | public function student() 48 | { 49 | return $this->hasOne(Student::class); 50 | } 51 | 52 | public function parent() 53 | { 54 | return $this->hasOne(Parents::class); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": [ 6 | "framework", 7 | "laravel" 8 | ], 9 | "license": "MIT", 10 | "require": { 11 | "php": "^7.1.3", 12 | "fideloper/proxy": "^4.0", 13 | "laravel/framework": "5.8.*", 14 | "laravel/tinker": "^1.0", 15 | "spatie/laravel-permission": "^2.37" 16 | }, 17 | "require-dev": { 18 | "beyondcode/laravel-dump-server": "^1.0", 19 | "filp/whoops": "^2.0", 20 | "fzaninotto/faker": "^1.4", 21 | "mockery/mockery": "^1.0", 22 | "nunomaduro/collision": "^3.0", 23 | "phpunit/phpunit": "^7.5" 24 | }, 25 | "config": { 26 | "optimize-autoloader": true, 27 | "preferred-install": "dist", 28 | "sort-packages": true 29 | }, 30 | "extra": { 31 | "laravel": { 32 | "dont-discover": [] 33 | } 34 | }, 35 | "autoload": { 36 | "psr-4": { 37 | "App\\": "app/" 38 | }, 39 | "classmap": [ 40 | "database/seeds", 41 | "database/factories" 42 | ] 43 | }, 44 | "autoload-dev": { 45 | "psr-4": { 46 | "Tests\\": "tests/" 47 | } 48 | }, 49 | "minimum-stability": "dev", 50 | "prefer-stable": true, 51 | "scripts": { 52 | "post-autoload-dump": [ 53 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 54 | "@php artisan package:discover --ansi" 55 | ], 56 | "post-root-package-install": [ 57 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 58 | ], 59 | "post-create-project-cmd": [ 60 | "@php artisan key:generate --ansi" 61 | ] 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session", "token" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | 44 | 'api' => [ 45 | 'driver' => 'token', 46 | 'provider' => 'users', 47 | 'hash' => false, 48 | ], 49 | ], 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | User Providers 54 | |-------------------------------------------------------------------------- 55 | | 56 | | All authentication drivers have a user provider. This defines how the 57 | | users are actually retrieved out of your database or other storage 58 | | mechanisms used by this application to persist your user's data. 59 | | 60 | | If you have multiple user tables or models you may configure multiple 61 | | sources which represent each model / table. These sources may then 62 | | be assigned to any extra authentication guards you have defined. 63 | | 64 | | Supported: "database", "eloquent" 65 | | 66 | */ 67 | 68 | 'providers' => [ 69 | 'users' => [ 70 | 'driver' => 'eloquent', 71 | 'model' => App\User::class, 72 | ], 73 | 74 | // 'users' => [ 75 | // 'driver' => 'database', 76 | // 'table' => 'users', 77 | // ], 78 | ], 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | Resetting Passwords 83 | |-------------------------------------------------------------------------- 84 | | 85 | | You may specify multiple password reset configurations if you have more 86 | | than one user table or model in the application and you want to have 87 | | separate password reset settings based on the specific user types. 88 | | 89 | | The expire time is the number of minutes that the reset token should be 90 | | considered valid. This security feature keeps tokens short-lived so 91 | | they have less time to be guessed. You may change this as needed. 92 | | 93 | */ 94 | 95 | 'passwords' => [ 96 | 'users' => [ 97 | 'provider' => 'users', 98 | 'table' => 'password_resets', 99 | 'expire' => 60, 100 | ], 101 | ], 102 | 103 | ]; 104 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'encrypted' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Cache Stores 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may define all of the cache "stores" for your application as 29 | | well as their drivers. You may even define multiple stores for the 30 | | same cache driver to group types of items stored in your caches. 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | ], 43 | 44 | 'database' => [ 45 | 'driver' => 'database', 46 | 'table' => 'cache', 47 | 'connection' => null, 48 | ], 49 | 50 | 'file' => [ 51 | 'driver' => 'file', 52 | 'path' => storage_path('framework/cache/data'), 53 | ], 54 | 55 | 'memcached' => [ 56 | 'driver' => 'memcached', 57 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 58 | 'sasl' => [ 59 | env('MEMCACHED_USERNAME'), 60 | env('MEMCACHED_PASSWORD'), 61 | ], 62 | 'options' => [ 63 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 64 | ], 65 | 'servers' => [ 66 | [ 67 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 68 | 'port' => env('MEMCACHED_PORT', 11211), 69 | 'weight' => 100, 70 | ], 71 | ], 72 | ], 73 | 74 | 'redis' => [ 75 | 'driver' => 'redis', 76 | 'connection' => 'cache', 77 | ], 78 | 79 | 'dynamodb' => [ 80 | 'driver' => 'dynamodb', 81 | 'key' => env('AWS_ACCESS_KEY_ID'), 82 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 83 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 84 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 85 | ], 86 | 87 | ], 88 | 89 | /* 90 | |-------------------------------------------------------------------------- 91 | | Cache Key Prefix 92 | |-------------------------------------------------------------------------- 93 | | 94 | | When utilizing a RAM based store such as APC or Memcached, there might 95 | | be other applications utilizing the same cache. So, we'll specify a 96 | | value to get prefixed to all our keys so we can avoid collisions. 97 | | 98 | */ 99 | 100 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 101 | 102 | ]; 103 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_ACCESS_KEY_ID'), 61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 62 | 'region' => env('AWS_DEFAULT_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | 'url' => env('AWS_URL'), 65 | ], 66 | 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Log Channels 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may configure the log channels for your application. Out of 27 | | the box, Laravel uses the Monolog PHP logging library. This gives 28 | | you a variety of powerful log handlers / formatters to utilize. 29 | | 30 | | Available Drivers: "single", "daily", "slack", "syslog", 31 | | "errorlog", "monolog", 32 | | "custom", "stack" 33 | | 34 | */ 35 | 36 | 'channels' => [ 37 | 'stack' => [ 38 | 'driver' => 'stack', 39 | 'channels' => ['daily'], 40 | 'ignore_exceptions' => false, 41 | ], 42 | 43 | 'single' => [ 44 | 'driver' => 'single', 45 | 'path' => storage_path('logs/laravel.log'), 46 | 'level' => 'debug', 47 | ], 48 | 49 | 'daily' => [ 50 | 'driver' => 'daily', 51 | 'path' => storage_path('logs/laravel.log'), 52 | 'level' => 'debug', 53 | 'days' => 14, 54 | ], 55 | 56 | 'slack' => [ 57 | 'driver' => 'slack', 58 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 59 | 'username' => 'Laravel Log', 60 | 'emoji' => ':boom:', 61 | 'level' => 'critical', 62 | ], 63 | 64 | 'papertrail' => [ 65 | 'driver' => 'monolog', 66 | 'level' => 'debug', 67 | 'handler' => SyslogUdpHandler::class, 68 | 'handler_with' => [ 69 | 'host' => env('PAPERTRAIL_URL'), 70 | 'port' => env('PAPERTRAIL_PORT'), 71 | ], 72 | ], 73 | 74 | 'stderr' => [ 75 | 'driver' => 'monolog', 76 | 'handler' => StreamHandler::class, 77 | 'formatter' => env('LOG_STDERR_FORMATTER'), 78 | 'with' => [ 79 | 'stream' => 'php://stderr', 80 | ], 81 | ], 82 | 83 | 'syslog' => [ 84 | 'driver' => 'syslog', 85 | 'level' => 'debug', 86 | ], 87 | 88 | 'errorlog' => [ 89 | 'driver' => 'errorlog', 90 | 'level' => 'debug', 91 | ], 92 | ], 93 | 94 | ]; 95 | -------------------------------------------------------------------------------- /config/permission.php: -------------------------------------------------------------------------------- 1 | [ 6 | 7 | /* 8 | * When using the "HasPermissions" trait from this package, we need to know which 9 | * Eloquent model should be used to retrieve your permissions. Of course, it 10 | * is often just the "Permission" model but you may use whatever you like. 11 | * 12 | * The model you want to use as a Permission model needs to implement the 13 | * `Spatie\Permission\Contracts\Permission` contract. 14 | */ 15 | 16 | 'permission' => Spatie\Permission\Models\Permission::class, 17 | 18 | /* 19 | * When using the "HasRoles" trait from this package, we need to know which 20 | * Eloquent model should be used to retrieve your roles. Of course, it 21 | * is often just the "Role" model but you may use whatever you like. 22 | * 23 | * The model you want to use as a Role model needs to implement the 24 | * `Spatie\Permission\Contracts\Role` contract. 25 | */ 26 | 27 | 'role' => Spatie\Permission\Models\Role::class, 28 | 29 | ], 30 | 31 | 'table_names' => [ 32 | 33 | /* 34 | * When using the "HasRoles" trait from this package, we need to know which 35 | * table should be used to retrieve your roles. We have chosen a basic 36 | * default value but you may easily change it to any table you like. 37 | */ 38 | 39 | 'roles' => 'roles', 40 | 41 | /* 42 | * When using the "HasPermissions" trait from this package, we need to know which 43 | * table should be used to retrieve your permissions. We have chosen a basic 44 | * default value but you may easily change it to any table you like. 45 | */ 46 | 47 | 'permissions' => 'permissions', 48 | 49 | /* 50 | * When using the "HasPermissions" trait from this package, we need to know which 51 | * table should be used to retrieve your models permissions. We have chosen a 52 | * basic default value but you may easily change it to any table you like. 53 | */ 54 | 55 | 'model_has_permissions' => 'model_has_permissions', 56 | 57 | /* 58 | * When using the "HasRoles" trait from this package, we need to know which 59 | * table should be used to retrieve your models roles. We have chosen a 60 | * basic default value but you may easily change it to any table you like. 61 | */ 62 | 63 | 'model_has_roles' => 'model_has_roles', 64 | 65 | /* 66 | * When using the "HasRoles" trait from this package, we need to know which 67 | * table should be used to retrieve your roles permissions. We have chosen a 68 | * basic default value but you may easily change it to any table you like. 69 | */ 70 | 71 | 'role_has_permissions' => 'role_has_permissions', 72 | ], 73 | 74 | 'column_names' => [ 75 | 76 | /* 77 | * Change this if you want to name the related model primary key other than 78 | * `model_id`. 79 | * 80 | * For example, this would be nice if your primary keys are all UUIDs. In 81 | * that case, name this `model_uuid`. 82 | */ 83 | 84 | 'model_morph_key' => 'model_id', 85 | ], 86 | 87 | /* 88 | * When set to true, the required permission/role names are added to the exception 89 | * message. This could be considered an information leak in some contexts, so 90 | * the default setting is false here for optimum safety. 91 | */ 92 | 93 | 'display_permission_in_exception' => false, 94 | 95 | 'cache' => [ 96 | 97 | /* 98 | * By default all permissions are cached for 24 hours to speed up performance. 99 | * When permissions or roles are updated the cache is flushed automatically. 100 | */ 101 | 102 | 'expiration_time' => \DateInterval::createFromDateString('24 hours'), 103 | 104 | /* 105 | * The cache key used to store all permissions. 106 | */ 107 | 108 | 'key' => 'spatie.permission.cache', 109 | 110 | /* 111 | * When checking for a permission against a model by passing a Permission 112 | * instance to the check, this key determines what attribute on the 113 | * Permissions model is used to cache against. 114 | * 115 | * Ideally, this should match your preferred way of checking permissions, eg: 116 | * `$user->can('view-posts')` would be 'name'. 117 | */ 118 | 119 | 'model_key' => 'name', 120 | 121 | /* 122 | * You may optionally indicate a specific cache driver to use for permission and 123 | * role caching using any of the `store` drivers listed in the cache.php config 124 | * file. Using 'default' here means to use the `default` set in cache.php. 125 | */ 126 | 127 | 'store' => 'default', 128 | ], 129 | ]; 130 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | 'block_for' => 0, 50 | ], 51 | 52 | 'sqs' => [ 53 | 'driver' => 'sqs', 54 | 'key' => env('AWS_ACCESS_KEY_ID'), 55 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 56 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 57 | 'queue' => env('SQS_QUEUE', 'your-queue-name'), 58 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 59 | ], 60 | 61 | 'redis' => [ 62 | 'driver' => 'redis', 63 | 'connection' => 'default', 64 | 'queue' => env('REDIS_QUEUE', 'default'), 65 | 'retry_after' => 90, 66 | 'block_for' => null, 67 | ], 68 | 69 | ], 70 | 71 | /* 72 | |-------------------------------------------------------------------------- 73 | | Failed Queue Jobs 74 | |-------------------------------------------------------------------------- 75 | | 76 | | These options configure the behavior of failed queue job logging so you 77 | | can control which database and table are used to store the jobs that 78 | | have failed. You may change them to any database / table you wish. 79 | | 80 | */ 81 | 82 | 'failed' => [ 83 | 'database' => env('DB_CONNECTION', 'mysql'), 84 | 'table' => 'failed_jobs', 85 | ], 86 | 87 | ]; 88 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | 'sparkpost' => [ 34 | 'secret' => env('SPARKPOST_SECRET'), 35 | ], 36 | 37 | 'stripe' => [ 38 | 'model' => App\User::class, 39 | 'key' => env('STRIPE_KEY'), 40 | 'secret' => env('STRIPE_SECRET'), 41 | 'webhook' => [ 42 | 'secret' => env('STRIPE_WEBHOOK_SECRET'), 43 | 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300), 44 | ], 45 | ], 46 | 47 | ]; 48 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(User::class, function (Faker $faker) { 20 | return [ 21 | 'name' => $faker->name, 22 | 'email' => $faker->unique()->safeEmail, 23 | 'email_verified_at' => now(), 24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 25 | 'remember_token' => Str::random(10), 26 | ]; 27 | }); 28 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->string('profile_picture')->default('avatar.png'); 23 | $table->rememberToken(); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('users'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2019_05_14_114748_create_permission_tables.php: -------------------------------------------------------------------------------- 1 | increments('id'); 21 | $table->string('name'); 22 | $table->string('guard_name'); 23 | $table->timestamps(); 24 | }); 25 | 26 | Schema::create($tableNames['roles'], function (Blueprint $table) { 27 | $table->increments('id'); 28 | $table->string('name'); 29 | $table->string('guard_name'); 30 | $table->timestamps(); 31 | }); 32 | 33 | Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) { 34 | $table->unsignedInteger('permission_id'); 35 | 36 | $table->string('model_type'); 37 | $table->unsignedBigInteger($columnNames['model_morph_key']); 38 | $table->index([$columnNames['model_morph_key'], 'model_type', ]); 39 | 40 | $table->foreign('permission_id') 41 | ->references('id') 42 | ->on($tableNames['permissions']) 43 | ->onDelete('cascade'); 44 | 45 | $table->primary(['permission_id', $columnNames['model_morph_key'], 'model_type'], 46 | 'model_has_permissions_permission_model_type_primary'); 47 | }); 48 | 49 | Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) { 50 | $table->unsignedInteger('role_id'); 51 | 52 | $table->string('model_type'); 53 | $table->unsignedBigInteger($columnNames['model_morph_key']); 54 | $table->index([$columnNames['model_morph_key'], 'model_type', ]); 55 | 56 | $table->foreign('role_id') 57 | ->references('id') 58 | ->on($tableNames['roles']) 59 | ->onDelete('cascade'); 60 | 61 | $table->primary(['role_id', $columnNames['model_morph_key'], 'model_type'], 62 | 'model_has_roles_role_model_type_primary'); 63 | }); 64 | 65 | Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) { 66 | $table->unsignedInteger('permission_id'); 67 | $table->unsignedInteger('role_id'); 68 | 69 | $table->foreign('permission_id') 70 | ->references('id') 71 | ->on($tableNames['permissions']) 72 | ->onDelete('cascade'); 73 | 74 | $table->foreign('role_id') 75 | ->references('id') 76 | ->on($tableNames['roles']) 77 | ->onDelete('cascade'); 78 | 79 | $table->primary(['permission_id', 'role_id']); 80 | }); 81 | 82 | app('cache') 83 | ->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null) 84 | ->forget(config('permission.cache.key')); 85 | } 86 | 87 | /** 88 | * Reverse the migrations. 89 | * 90 | * @return void 91 | */ 92 | public function down() 93 | { 94 | $tableNames = config('permission.table_names'); 95 | 96 | Schema::drop($tableNames['role_has_permissions']); 97 | Schema::drop($tableNames['model_has_roles']); 98 | Schema::drop($tableNames['model_has_permissions']); 99 | Schema::drop($tableNames['roles']); 100 | Schema::drop($tableNames['permissions']); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /database/migrations/2019_05_15_180937_create_students_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->unsignedBigInteger('user_id'); 19 | $table->unsignedBigInteger('parent_id'); 20 | $table->unsignedBigInteger('class_id'); 21 | $table->unsignedBigInteger('roll_number'); 22 | $table->enum('gender', ['male', 'female', 'other']); 23 | $table->string('phone'); 24 | $table->date('dateofbirth'); 25 | $table->string('current_address'); 26 | $table->string('permanent_address'); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::dropIfExists('students'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /database/migrations/2019_05_15_181154_create_parents_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->unsignedBigInteger('user_id'); 19 | $table->enum('gender', ['male', 'female']); 20 | $table->string('phone'); 21 | $table->string('current_address'); 22 | $table->string('permanent_address'); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('parents'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2019_05_15_181254_create_teachers_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->unsignedBigInteger('user_id'); 19 | $table->enum('gender', ['male', 'female', 'other']); 20 | $table->string('phone'); 21 | $table->date('dateofbirth'); 22 | $table->string('current_address'); 23 | $table->string('permanent_address'); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('teachers'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /database/migrations/2019_05_15_181552_create_grades_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->unsignedBigInteger('teacher_id'); 19 | $table->unsignedBigInteger('class_numeric'); 20 | $table->string('class_name'); 21 | $table->string('class_description'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('grades'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2019_05_16_174745_create_subjects_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('name'); 19 | $table->string('slug'); 20 | $table->unsignedBigInteger('subject_code'); 21 | $table->unsignedBigInteger('teacher_id'); 22 | $table->text('description'); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('subjects'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2019_05_16_175620_create_grade_subject_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->unsignedBigInteger('grade_id'); 19 | $table->unsignedBigInteger('subject_id'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('grade_subject'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2019_05_17_133226_create_attendances_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->unsignedBigInteger('class_id'); 19 | $table->unsignedBigInteger('teacher_id'); 20 | $table->unsignedBigInteger('student_id'); 21 | $table->date('attendence_date'); 22 | $table->boolean('attendence_status'); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('attendances'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(RolesAndPermissionsSeeder::class); 19 | 20 | $user = User::create([ 21 | 'name' => 'Admin', 22 | 'email' => 'admin@demo.com', 23 | 'password' => bcrypt('12345678'), 24 | 'created_at' => date("Y-m-d H:i:s") 25 | ]); 26 | $user->assignRole('Admin'); 27 | 28 | $user2 = User::create([ 29 | 'name' => 'Teacher', 30 | 'email' => 'teacher@demo.com', 31 | 'password' => bcrypt('12345678'), 32 | 'created_at' => date("Y-m-d H:i:s") 33 | ]); 34 | $user2->assignRole('Teacher'); 35 | 36 | $user3 = User::create([ 37 | 'name' => 'Parent', 38 | 'email' => 'parent@demo.com', 39 | 'password' => bcrypt('12345678'), 40 | 'created_at' => date("Y-m-d H:i:s") 41 | ]); 42 | $user3->assignRole('Parent'); 43 | 44 | $user4 = User::create([ 45 | 'name' => 'Student', 46 | 'email' => 'student@demo.com', 47 | 'password' => bcrypt('12345678'), 48 | 'created_at' => date("Y-m-d H:i:s") 49 | ]); 50 | $user4->assignRole('Student'); 51 | 52 | 53 | DB::table('teachers')->insert([ 54 | [ 55 | 'user_id' => $user2->id, 56 | 'gender' => 'male', 57 | 'phone' => '0123456789', 58 | 'dateofbirth' => '1993-04-11', 59 | 'current_address' => 'Dhaka-1215', 60 | 'permanent_address' => 'Dhaka-1215', 61 | 'created_at' => date("Y-m-d H:i:s") 62 | ] 63 | ]); 64 | 65 | DB::table('parents')->insert([ 66 | [ 67 | 'user_id' => $user3->id, 68 | 'gender' => 'male', 69 | 'phone' => '0123456789', 70 | 'current_address' => 'Dhaka-1215', 71 | 'permanent_address' => 'Dhaka-1215', 72 | 'created_at' => date("Y-m-d H:i:s") 73 | ] 74 | ]); 75 | 76 | DB::table('grades')->insert([ 77 | 'teacher_id' => 1, 78 | 'class_numeric' => 1, 79 | 'class_name' => 'One', 80 | 'class_description' => 'class one' 81 | ]); 82 | 83 | DB::table('students')->insert([ 84 | [ 85 | 'user_id' => $user4->id, 86 | 'parent_id' => 1, 87 | 'class_id' => 1, 88 | 'roll_number' => 1, 89 | 'gender' => 'male', 90 | 'phone' => '0123456789', 91 | 'dateofbirth' => '1993-04-11', 92 | 'current_address' => 'Dhaka-1215', 93 | 'permanent_address' => 'Dhaka-1215', 94 | 'created_at' => date("Y-m-d H:i:s") 95 | ] 96 | ]); 97 | 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /database/seeds/RolesAndPermissionsSeeder.php: -------------------------------------------------------------------------------- 1 | forgetCachedPermissions(); 18 | 19 | // create permissions 20 | // Permission::create(['name' => 'edit articles']); 21 | 22 | $role = Role::create(['name' => 'Admin']); 23 | $role = Role::create(['name' => 'Teacher']); 24 | $role = Role::create(['name' => 'Parent']); 25 | $role = Role::create(['name' => 'Student']); 26 | 27 | // $role->givePermissionTo('edit articles'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "npm run development -- --watch", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "cross-env": "^5.1", 14 | "jquery": "^3.2", 15 | "jquery-ui": "^1.12.1", 16 | "laravel-mix": "^4.0.7", 17 | "lodash": "^4.17.5", 18 | "popper.js": "^1.12", 19 | "resolve-url-loader": "^2.3.1", 20 | "sass": "^1.15.2", 21 | "sass-loader": "^7.1.0", 22 | "tailwindcss": "^1.0.1", 23 | "vue-template-compiler": "^2.6.10" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Unit 14 | 15 | 16 | 17 | ./tests/Feature 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Handle Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/css/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/public/css/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/public/css/images/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_555555_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/public/css/images/ui-icons_555555_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_777620_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/public/css/images/ui-icons_777620_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_777777_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/public/css/images/ui-icons_777777_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_cc0000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/public/css/images/ui-icons_cc0000_256x240.png -------------------------------------------------------------------------------- /public/css/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/public/css/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/public/favicon.ico -------------------------------------------------------------------------------- /public/images/profile/admin-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/public/images/profile/admin-1.png -------------------------------------------------------------------------------- /public/images/profile/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/public/images/profile/avatar.png -------------------------------------------------------------------------------- /public/images/profile/teacher-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/public/images/profile/teacher-2.png -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | define('LARAVEL_START', microtime(true)); 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Register The Auto Loader 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Composer provides a convenient, automatically generated class loader for 18 | | our application. We just need to utilize it! We'll simply require it 19 | | into the script here so that we don't have to worry about manual 20 | | loading any of our classes later on. It feels great to relax. 21 | | 22 | */ 23 | 24 | require __DIR__.'/../vendor/autoload.php'; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Turn On The Lights 29 | |-------------------------------------------------------------------------- 30 | | 31 | | We need to illuminate PHP development, so let us turn on the lights. 32 | | This bootstraps the framework and gets it ready for use, then it 33 | | will load up this application so that we can run it and send 34 | | the responses back to the browser and delight our users. 35 | | 36 | */ 37 | 38 | $app = require_once __DIR__.'/../bootstrap/app.php'; 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Run The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once we have the application, we can handle the incoming request 46 | | through the kernel, and send the associated response back to 47 | | the client's browser allowing them to enjoy the creative 48 | | and wonderful application we have prepared for them. 49 | | 50 | */ 51 | 52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 53 | 54 | $response = $kernel->handle( 55 | $request = Illuminate\Http\Request::capture() 56 | ); 57 | 58 | $response->send(); 59 | 60 | $kernel->terminate($request, $response); 61 | -------------------------------------------------------------------------------- /public/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/js/app.js": "/js/app.js", 3 | "/css/app.css": "/css/app.css" 4 | } 5 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | /** 2 | * First we will load all of this project's JavaScript dependencies which 3 | * includes Vue and other libraries. It is a great starting point when 4 | * building robust, powerful web applications using Vue and Laravel. 5 | */ 6 | 7 | require('./bootstrap'); 8 | 9 | import $ from 'jquery'; 10 | window.$ = window.jQuery = $; 11 | 12 | import 'jquery-ui/ui/widgets/datepicker.js'; 13 | 14 | // window.Vue = require('vue'); 15 | 16 | /** 17 | * The following block of code may be used to automatically register your 18 | * Vue components. It will recursively scan this directory for the Vue 19 | * components and automatically register them with their "basename". 20 | * 21 | * Eg. ./components/ExampleComponent.vue -> 22 | */ 23 | 24 | // const files = require.context('./', true, /\.vue$/i); 25 | // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)); 26 | 27 | // Vue.component('example-component', require('./components/ExampleComponent.vue').default); 28 | 29 | /** 30 | * Next, we will create a fresh Vue application instance and attach it to 31 | * the page. Then, you may begin adding components to this application 32 | * or customize the JavaScript scaffolding to fit your unique needs. 33 | */ 34 | 35 | // const app = new Vue({ 36 | // el: '#app', 37 | // }); -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | window._ = require('lodash'); 2 | 3 | /** 4 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 5 | * for JavaScript based Bootstrap features such as modals and tabs. This 6 | * code may be modified to fit the specific needs of your application. 7 | */ 8 | 9 | try { 10 | window.Popper = require('popper.js').default; 11 | window.$ = window.jQuery = require('jquery'); 12 | 13 | require('bootstrap'); 14 | } catch (e) {} 15 | 16 | /** 17 | * We'll load the axios HTTP library which allows us to easily issue requests 18 | * to our Laravel back-end. This library automatically handles sending the 19 | * CSRF token as a header based on the value of the "XSRF" token cookie. 20 | */ 21 | 22 | // window.axios = require('axios'); 23 | 24 | // window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 25 | 26 | /** 27 | * Next we will register the CSRF Token as a common header with Axios so that 28 | * all outgoing HTTP requests automatically have it attached. This is just 29 | * a simple convenience so we don't have to attach every token manually. 30 | */ 31 | 32 | // let token = document.head.querySelector('meta[name="csrf-token"]'); 33 | 34 | // if (token) { 35 | // window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 36 | // } else { 37 | // console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 38 | // } 39 | 40 | /** 41 | * Echo exposes an expressive API for subscribing to channels and listening 42 | * for events that are broadcast by Laravel. Echo and event broadcasting 43 | * allows your team to easily build robust real-time web applications. 44 | */ 45 | 46 | // import Echo from 'laravel-echo' 47 | 48 | // window.Pusher = require('pusher-js'); 49 | 50 | // window.Echo = new Echo({ 51 | // broadcaster: 'pusher', 52 | // key: process.env.MIX_PUSHER_APP_KEY, 53 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 54 | // encrypted: true 55 | // }); -------------------------------------------------------------------------------- /resources/js/components/ExampleComponent.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least eight characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/sass/app.scss: -------------------------------------------------------------------------------- 1 | @import '~jquery-ui/themes/base/all.css'; 2 | .ui-datepicker-header.ui-widget-header.ui-helper-clearfix.ui-corner-all { 3 | background: #edf2f7 !important; 4 | } 5 | 6 | @tailwind base; 7 | @tailwind components; 8 | @tailwind utilities; 9 | .modal-bg { 10 | background-color: rgba(0, 0, 0, 0.4); 11 | } -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.frontend') 2 | 3 | @section('content') 4 | 5 |
6 |
7 | @csrf 8 |
9 | 12 | 13 | @error('email') 14 |

{{ $message }}

15 | @enderror 16 |
17 |
18 | 21 | 22 | @error('password') 23 |

{{ $message }}

24 | @enderror 25 |
26 |
27 | 33 |
34 |
35 | 38 |
39 |
40 |
41 | 42 | @endsection 43 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.frontend') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Reset Password') }}
9 | 10 |
11 | @if (session('status')) 12 | 15 | @endif 16 | 17 |
18 | @csrf 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | @error('email') 27 | 28 | {{ $message }} 29 | 30 | @enderror 31 |
32 |
33 | 34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | @endsection 48 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.frontend') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Reset Password') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @error('email') 23 | 24 | {{ $message }} 25 | 26 | @enderror 27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 | 36 | @error('password') 37 | 38 | {{ $message }} 39 | 40 | @enderror 41 |
42 |
43 | 44 |
45 | 46 | 47 |
48 | 49 |
50 |
51 | 52 |
53 |
54 | 57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | @endsection 66 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.frontend') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Register') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @error('name') 21 | 22 | {{ $message }} 23 | 24 | @enderror 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @error('email') 35 | 36 | {{ $message }} 37 | 38 | @enderror 39 |
40 |
41 | 42 |
43 | 44 | 45 |
46 | 47 | 48 | @error('password') 49 | 50 | {{ $message }} 51 | 52 | @enderror 53 |
54 |
55 | 56 |
57 | 58 | 59 |
60 | 61 |
62 |
63 | 64 |
65 |
66 | 69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | @endsection 78 | -------------------------------------------------------------------------------- /resources/views/auth/verify.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.frontend') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Verify Your Email Address') }}
9 | 10 |
11 | @if (session('resent')) 12 | 15 | @endif 16 | 17 | {{ __('Before proceeding, please check your email for a verification link.') }} 18 | {{ __('If you did not receive the email') }}, {{ __('click here to request another') }}. 19 |
20 |
21 |
22 |
23 |
24 | @endsection 25 | -------------------------------------------------------------------------------- /resources/views/backend/assignrole/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Assign Role

8 |
9 | 15 |
16 |
17 |
18 |
Name
19 |
Email
20 |
Role
21 |
Assign
22 |
23 | @foreach ($users as $user) 24 |
25 |
{{ $user->name }}
26 |
{{ $user->email }}
27 |
28 | @foreach ($user->roles as $role) 29 | {{ $role->name }} 30 | @endforeach 31 |
32 |
33 | 34 | 35 | 36 |
37 |
38 | @endforeach 39 |
40 |
41 | {{ $users->links() }} 42 |
43 |
44 | @endsection -------------------------------------------------------------------------------- /resources/views/backend/attendance/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 | 6 |
7 |
8 |

Attendance for {{ $class->class_name }}

9 |
10 | 16 |
17 | 18 |
19 |
20 |
21 | @error('attendences') 22 | {{ $message }} 23 | @enderror 24 | @if(session('status')) 25 | {{ session('status') }} 26 | @endif 27 |
28 |

Date: {{ date('Y-m-d') }}

29 |
30 | 31 |
32 |
33 |
Name
34 |
Roll
35 |
Attendence
36 |
37 |
38 | @foreach ($class->students as $student) 39 |
40 | @csrf 41 |
{{ $student->user->name }}
42 |
{{ $student->roll_number }}
43 |
44 | 48 | 52 |
53 | 54 | 55 |
56 | @endforeach 57 |
58 | 61 |
62 |
63 |
64 |
65 | 66 |
67 | @endsection -------------------------------------------------------------------------------- /resources/views/backend/attendance/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 | 6 |
7 |
8 |

Attendance

9 |
10 | 16 |
17 | 18 |
19 |
20 |
21 |

{{ $attendances[0]->student->user->name ?? '' }}

22 |
23 |
24 | 25 |
26 |
27 |
Date
28 |
Teacher
29 |
Class
30 |
Attendence
31 |
32 | @foreach ($attendances as $attendance) 33 |
34 |
{{ $attendance->attendence_date }}
35 |
{{ $attendance->teacher->user->name }}
36 |
{{ $attendance->class->class_name }}
37 |
38 | @if ($attendance->attendence_status) 39 | Present 40 | @else 41 | Absent 42 | @endif 43 |
44 |
45 | @endforeach 46 |
47 |
48 | 49 |
50 | @endsection -------------------------------------------------------------------------------- /resources/views/backend/classes/assign-subject.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 | 6 |
7 |
8 |

Assign Subject

9 |
10 | 16 |
17 | 18 |
19 |
20 | @csrf 21 |
22 |
23 | 26 |
27 |
28 | @foreach ($subjects as $subject) 29 |
30 | 40 |
41 | @endforeach 42 |
43 |
44 |
45 |
46 |
47 | 50 |
51 |
52 |
53 |
54 | 55 |
56 |

Students

57 |
58 |
Name
59 |
Email
60 |
Phone
61 |
Parent
62 |
63 | @foreach ($assigned->students as $student) 64 |
65 |
{{ $student->user->name }}
66 |
{{ $student->user->email }}
67 |
{{ $student->phone }}
68 |
{{ $student->parent->user->name }}
69 |
70 | @endforeach 71 |
72 |
73 | @endsection -------------------------------------------------------------------------------- /resources/views/backend/modals/delete.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/views/backend/permissions/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 | 6 |
7 |
8 |

Edit Permission

9 |
10 | 20 |
21 | 22 |
23 |
24 | @csrf 25 | @method('PUT') 26 |
27 |
28 | 31 |
32 |
33 | 34 | @error('name') 35 |

{{ $message }}

36 | @enderror 37 |
38 |
39 |
40 |
41 | 44 |
45 |
46 | @foreach ($roles as $role) 47 |
48 | 58 |
59 | @endforeach 60 |
61 |
62 |
63 |
64 |
65 | 68 |
69 |
70 |
71 |
72 | 73 |
74 | @endsection -------------------------------------------------------------------------------- /resources/views/backend/roles/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 | 6 |
7 |
8 |

Create Role

9 |
10 | 20 |
21 | 22 |
23 |
24 | @csrf 25 |
26 |
27 | 30 |
31 |
32 | 33 | @error('name') 34 |

{{ $message }}

35 | @enderror 36 |
37 |
38 |
39 |
40 | 43 |
44 |
45 | @foreach ($permissions as $permission) 46 |
47 | 53 |
54 | @endforeach 55 |
56 |
57 |
58 |
59 |
60 | 63 |
64 |
65 |
66 |
67 | 68 |
69 | @endsection -------------------------------------------------------------------------------- /resources/views/backend/roles/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Roles & Permissions

8 |
9 | 19 |
20 |
21 |
22 |
Role
23 |
Permissions
24 |
Edit
25 |
26 | @foreach ($roles as $role) 27 |
28 |
{{ $role->name }}
29 |
30 | @foreach ($role->permissions as $permission) 31 | {{ $permission->name }} 32 | @endforeach 33 |
34 |
35 | 36 | 37 | 38 |
39 |
40 | @endforeach 41 |
42 |
43 | @endsection -------------------------------------------------------------------------------- /resources/views/backend/subjects/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Subjects

8 |
9 | 15 |
16 |
17 |
18 |
Name
19 |
Code
20 |
Teacher
21 |
Description
22 |
Action
23 |
24 | @foreach ($subjects as $subject) 25 |
26 |
{{ $subject->name }}
27 |
{{ $subject->subject_code }}
28 |
{{ $subject->teacher->user->name }}
29 |
{{ $subject->description }}
30 |
31 | 32 | 33 | 34 |
35 | @csrf 36 | @method('DELETE') 37 | 40 |
41 |
42 |
43 | @endforeach 44 |
45 |
46 | {{ $subjects->links() }} 47 |
48 |
49 | @endsection -------------------------------------------------------------------------------- /resources/views/dashboard/admin.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

5 | {{ sprintf("%02d", count($parents)) }} 6 | Parents 7 |

8 |
9 |
10 |

11 | {{ sprintf("%02d", count($teachers)) }} 12 | Teachers 13 |

14 |
15 |
16 |

17 | {{ sprintf("%02d", count($students)) }} 18 | Students 19 |

20 |
21 |
22 |
-------------------------------------------------------------------------------- /resources/views/dashboard/parents.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

5 | {{ sprintf("%02d", $parents->children_count) }} 6 | Children 7 |

8 |
9 |
10 |
11 | 12 |
13 |
14 | @foreach ($parents->children as $key => $children) 15 |
16 |
17 |
18 |
{{ $children->user->name }}
19 |
{{ $children->user->email }}
20 |
21 | 22 |
23 |
Class :
24 |
{{ $children->class->class_name }}
25 |
26 |
27 |
Role :
28 |
{{ $children->roll_number }}
29 |
30 |
31 |
Phone :
32 |
{{ $children->phone }}
33 |
34 |
35 |
Gender :
36 |
{{ $children->gender }}
37 |
38 |
39 |
Date of Birth :
40 |
{{ $children->dateofbirth }}
41 |
42 |
43 |
Address :
44 |
{{ $children->current_address }}
45 |
46 | 47 |
48 | Attendence 49 | Fees 50 |
51 |
52 |
53 | @endforeach 54 |
55 |
-------------------------------------------------------------------------------- /resources/views/dashboard/teacher.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

5 | {{ sprintf("%02d", $teacher->classes_count) }} 6 | Classes 7 |

8 |
9 |
10 |

11 | {{ sprintf("%02d", $teacher->subjects_count) }} 12 | Subjects 13 |

14 |
15 |
16 |

17 | {{ ($teacher->students[0]->students_count) ?? 0 }} 18 | Students 19 |

20 |
21 |
22 |
23 |
24 |
25 |
26 |

Class List

27 |
28 | @foreach ($teacher->classes as $class) 29 |
30 |
{{ $class->class_name }}
31 | Attendence 32 |
33 | @endforeach 34 |
35 |
36 |
37 |

Subject List

38 |
39 |
Code
40 |
Subject
41 |
Teacher
42 |
43 | @foreach ($teacher->subjects as $subject) 44 |
45 |
{{ $subject->subject_code }}
46 |
{{ $subject->name }}
47 |
{{ $subject->teacher->user->name }}
48 |
49 | @endforeach 50 |
51 |
52 |
-------------------------------------------------------------------------------- /resources/views/errors/403.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

403

8 |

User does not have the right roles.

9 | Back to Home. 10 |
11 |
12 | 13 | @endsection -------------------------------------------------------------------------------- /resources/views/errors/404.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

404

8 |

Not Found.

9 | Back to Home. 10 |
11 |
12 | 13 | @endsection -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |
8 |

Dashboard

9 |
10 | 16 |
17 | 18 | @role('Admin') 19 | @include('dashboard.admin') 20 | @endrole 21 | 22 | @role('Parent') 23 | @include('dashboard.parents') 24 | @endrole 25 | 26 | @role('Teacher') 27 | @include('dashboard.teacher') 28 | @endrole 29 | 30 | @role('Student') 31 | @include('dashboard.student') 32 | @endrole 33 | 34 |
35 | 36 | @endsection 37 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ config('app.name', 'Laravel') }} 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | @include('layouts.navbar') 18 | 19 |
20 | 21 | @include('layouts.sidebar') 22 | 23 |
24 |
25 | 26 | @yield('content') 27 | 28 |
29 |
30 |
31 |
32 | 33 | 34 | 35 | 42 | 43 | @stack('scripts') 44 | 45 | 46 | -------------------------------------------------------------------------------- /resources/views/layouts/frontend.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ config('app.name', 'Laravel') }} 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | @include('layouts.navbar') 18 | 19 |
20 | 21 |
22 |
23 | 24 | @yield('content') 25 | 26 |
27 |
28 |
29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /resources/views/layouts/navbar.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | SCHOOL MS 5 |
6 |
7 | @auth 8 |
9 | Avatar 10 |

{{ auth()->user()->name }}

11 | 12 |
13 |
14 | 29 |
30 | @else 31 |
32 | @if (Route::has('login')) 33 |
34 | 35 | 36 | Login 37 | 38 |
39 | @endif 40 |
41 | @endauth 42 |
43 |
-------------------------------------------------------------------------------- /resources/views/profile/changepassword.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Profile

8 |
9 | 15 |
16 |
17 |
18 | @csrf 19 |
20 |
21 | 24 |
25 |
26 | 27 | @if(session('msg_currentpassword')) 28 |

{{ session('msg_currentpassword') }}

29 | @endif 30 |
31 |
32 |
33 |
34 | 37 |
38 |
39 | 40 | @error('newpassword') 41 |

{{ $message }}

42 | @enderror 43 |
44 |
45 |
46 |
47 | 50 |
51 |
52 | 53 |
54 |
55 |
56 |
57 |
58 | 61 |
62 |
63 |
64 |
65 |
66 | @endsection -------------------------------------------------------------------------------- /resources/views/profile/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Profile

8 |
9 | 19 |
20 |
21 |
22 |
23 |
24 |
25 | 28 |
29 |
30 | {{ auth()->user()->name }} 31 |
32 |
33 |
34 |
35 | 38 |
39 |
40 | {{ auth()->user()->email }} 41 |
42 |
43 |
44 |
45 | 48 |
49 |
50 | {{ auth()->user()->roles[0]->name ?? '' }} 51 |
52 |
53 |
54 |
55 |
56 | avatar 57 |
58 |
59 |
60 |
61 |
62 | @endsection -------------------------------------------------------------------------------- /resources/views/vendor/pagination/bootstrap-4.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 44 | @endif 45 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/default.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 44 | @endif 45 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/semantic-ui.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 36 | @endif 37 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/simple-bootstrap-4.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 25 | @endif 26 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/simple-default.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 17 | @endif 18 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Laravel 8 | 9 | 10 | 11 | 12 | 13 | 14 | 66 | 67 | 68 |
69 | @if (Route::has('login')) 70 | 81 | @endif 82 | 83 |
84 |
85 | Laravel 86 |
87 | 88 | 97 |
98 |
99 | 100 | 101 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 17 | return $request->user(); 18 | }); 19 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('home'); 21 | Route::get('/profile', 'HomeController@profile')->name('profile'); 22 | Route::get('/profile/edit', 'HomeController@profileEdit')->name('profile.edit'); 23 | Route::put('/profile/update', 'HomeController@profileUpdate')->name('profile.update'); 24 | Route::get('/profile/changepassword', 'HomeController@changePasswordForm')->name('profile.change.password'); 25 | Route::post('/profile/changepassword', 'HomeController@changePassword')->name('profile.changepassword'); 26 | 27 | Route::group(['middleware' => ['auth','role:Admin']], function () 28 | { 29 | Route::get('/roles-permissions', 'RolePermissionController@roles')->name('roles-permissions'); 30 | Route::get('/role-create', 'RolePermissionController@createRole')->name('role.create'); 31 | Route::post('/role-store', 'RolePermissionController@storeRole')->name('role.store'); 32 | Route::get('/role-edit/{id}', 'RolePermissionController@editRole')->name('role.edit'); 33 | Route::put('/role-update/{id}', 'RolePermissionController@updateRole')->name('role.update'); 34 | 35 | Route::get('/permission-create', 'RolePermissionController@createPermission')->name('permission.create'); 36 | Route::post('/permission-store', 'RolePermissionController@storePermission')->name('permission.store'); 37 | Route::get('/permission-edit/{id}', 'RolePermissionController@editPermission')->name('permission.edit'); 38 | Route::put('/permission-update/{id}', 'RolePermissionController@updatePermission')->name('permission.update'); 39 | 40 | Route::get('assign-subject-to-class/{id}', 'GradeController@assignSubject')->name('class.assign.subject'); 41 | Route::post('assign-subject-to-class/{id}', 'GradeController@storeAssignedSubject')->name('store.class.assign.subject'); 42 | 43 | Route::resource('assignrole', 'RoleAssign'); 44 | Route::resource('classes', 'GradeController'); 45 | Route::resource('subject', 'SubjectController'); 46 | Route::resource('teacher', 'TeacherController'); 47 | Route::resource('parents', 'ParentsController'); 48 | Route::resource('student', 'StudentController'); 49 | Route::get('attendance', 'AttendanceController@index')->name('attendance.index'); 50 | 51 | }); 52 | 53 | Route::group(['middleware' => ['auth','role:Teacher']], function () 54 | { 55 | Route::post('attendance', 'AttendanceController@store')->name('teacher.attendance.store'); 56 | Route::get('attendance-create/{classid}', 'AttendanceController@createByTeacher')->name('teacher.attendance.create'); 57 | }); 58 | 59 | Route::group(['middleware' => ['auth','role:Parent']], function () 60 | { 61 | Route::get('attendance/{attendance}', 'AttendanceController@show')->name('attendance.show'); 62 | }); 63 | 64 | Route::group(['middleware' => ['auth','role:Student']], function () { 65 | 66 | }); 67 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /v8-compile-cache-0/6.2.414.50/zSvarzSwwwzSschool-management-systemzSnode_moduleszSwebpack-clizSbinzScli.js.BLOB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parvez-git/laravel-school-management-system/89a71816148015e782d214fd7156dce65e509303/v8-compile-cache-0/6.2.414.50/zSvarzSwwwzSschool-management-systemzSnode_moduleszSwebpack-clizSbinzScli.js.BLOB -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | const mix = require('laravel-mix'); 2 | const tailwindcss = require('tailwindcss') 3 | 4 | /* 5 | |-------------------------------------------------------------------------- 6 | | Mix Asset Management 7 | |-------------------------------------------------------------------------- 8 | | 9 | | Mix provides a clean, fluent API for defining some Webpack build steps 10 | | for your Laravel application. By default, we are compiling the Sass 11 | | file for the application as well as bundling up all the JS files. 12 | | 13 | */ 14 | 15 | mix.js('resources/js/app.js', 'public/js') 16 | .sass('resources/sass/app.scss', 'public/css') 17 | .options({ 18 | processCssUrls: false, 19 | postCss: [tailwindcss('./tailwind.config.js')], 20 | }); --------------------------------------------------------------------------------