├── .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 |