├── .env.example ├── .gitattributes ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── app ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Group.php ├── Helpers │ └── functions.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── ChangePasswordController.php │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ └── ResetPasswordController.php │ │ ├── Controller.php │ │ ├── DashboardController.php │ │ ├── Groups │ │ │ ├── MeetingsController.php │ │ │ ├── MembersController.php │ │ │ └── PaymentsController.php │ │ ├── GroupsController.php │ │ └── MeetingsController.php │ ├── Kernel.php │ └── Middleware │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php ├── Meeting.php ├── Membership.php ├── Payment.php ├── Policies │ └── GroupPolicy.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.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 ├── mail.php ├── queue.php ├── services.php ├── session.php ├── simple-crud.php └── view.php ├── database ├── .gitignore ├── factories │ ├── GroupFactory.php │ ├── MeetingFactory.php │ ├── PaymentFactory.php │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2018_04_26_195126_create_groups_table.php │ ├── 2018_04_27_103238_create_group_members_table.php │ ├── 2018_04_29_171702_create_meetings_table.php │ └── 2018_05_06_110520_create_payments_table.php └── seeds │ └── DatabaseSeeder.php ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── css │ ├── app.css │ └── plugins │ │ └── jquery.datetimepicker.css ├── favicon.ico ├── index.php ├── js │ ├── app.js │ └── plugins │ │ ├── jquery.datetimepicker.js │ │ └── noty.js ├── mix-manifest.json ├── robots.txt ├── screenshots │ ├── dashboard-01.jpg │ ├── group-detail-01.jpg │ ├── group-meeting-list-01.jpg │ ├── group-members-01.jpg │ ├── group-outstanding-payments-01.jpg │ └── meeting-detail-01.jpg └── web.config ├── resources ├── assets │ ├── js │ │ ├── app.js │ │ └── bootstrap.js │ └── sass │ │ ├── _bootstrap-theme.css │ │ ├── _custom.scss │ │ ├── _variables.scss │ │ └── app.scss ├── lang │ ├── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php │ └── id │ │ ├── app.php │ │ ├── auth.php │ │ ├── group.php │ │ ├── meeting.php │ │ ├── nav_menu.php │ │ ├── payment.php │ │ └── user.php └── views │ ├── auth │ ├── login.blade.php │ ├── passwords │ │ ├── change.blade.php │ │ ├── email.blade.php │ │ └── reset.blade.php │ └── register.blade.php │ ├── groups │ ├── create.blade.php │ ├── edit.blade.php │ ├── index.blade.php │ ├── meetings.blade.php │ ├── members.blade.php │ ├── outstanding-payments.blade.php │ ├── partials │ │ └── nav-tabs.blade.php │ ├── show.blade.php │ └── wip.blade.php │ ├── home.blade.php │ ├── layouts │ ├── app.blade.php │ ├── group.blade.php │ └── partials │ │ ├── noty.blade.php │ │ └── top-nav.blade.php │ ├── meetings │ ├── partials │ │ ├── edit-meeting.blade.php │ │ ├── set-meeting.blade.php │ │ ├── set-winner.blade.php │ │ └── stats.blade.php │ └── show.blade.php │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── debugbar │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tests ├── CreatesApplication.php ├── Feature │ ├── Auth │ │ ├── ChangePasswordTest.php │ │ ├── LoginTest.php │ │ ├── RegistrationTest.php │ │ └── ResetPasswordTest.php │ ├── Groups │ │ ├── GroupDateEntryTest.php │ │ ├── GroupMemberEntryTest.php │ │ └── MeetingEntryTest.php │ ├── ManageGroupsTest.php │ └── Meetings │ │ ├── MeetingWinnerTest.php │ │ └── PaymentEntryTest.php ├── TestCase.php └── Unit │ ├── Models │ ├── GroupTest.php │ ├── MeetingTest.php │ ├── MembershipTest.php │ └── UserTest.php │ └── Policies │ └── GroupPolicyTest.php ├── webpack.mix.js └── yarn.lock /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_LOG_LEVEL=debug 6 | APP_URL=http://localhost 7 | 8 | DB_CONNECTION=mysql 9 | DB_HOST=127.0.0.1 10 | DB_PORT=3306 11 | DB_DATABASE=homestead 12 | DB_USERNAME=homestead 13 | DB_PASSWORD=secret 14 | 15 | BROADCAST_DRIVER=log 16 | CACHE_DRIVER=file 17 | SESSION_DRIVER=file 18 | SESSION_LIFETIME=120 19 | QUEUE_DRIVER=sync 20 | 21 | REDIS_HOST=127.0.0.1 22 | REDIS_PASSWORD=null 23 | REDIS_PORT=6379 24 | 25 | MAIL_DRIVER=smtp 26 | MAIL_HOST=smtp.mailtrap.io 27 | MAIL_PORT=2525 28 | MAIL_USERNAME=null 29 | MAIL_PASSWORD=null 30 | MAIL_ENCRYPTION=null 31 | 32 | PUSHER_APP_ID= 33 | PUSHER_APP_KEY= 34 | PUSHER_APP_SECRET= 35 | PUSHER_APP_CLUSTER=mt1 36 | -------------------------------------------------------------------------------- /.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 | /.idea 7 | /.vscode 8 | /.vagrant 9 | Homestead.json 10 | Homestead.yaml 11 | npm-debug.log 12 | yarn-error.log 13 | .env 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7.2 5 | 6 | before_script: 7 | - travis_retry composer self-update 8 | - travis_retry composer install --prefer-source --no-interaction --dev 9 | - cp .env.example .env 10 | - php artisan key:generate 11 | 12 | script: 13 | - vendor/bin/phpunit 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Nafies Luthfi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arisan 2 | 3 | Arisan adalah sebuah sistem pengelolaan grup arisan berbasis web yang dibangun dengan framework Laravel 5. 4 | 5 | ## Tujuan 6 | Arisan bertujuan untuk mempermudah pengelola arisan dalam mengatur pertemuan dan mengelola pembayaran anggota. 7 | 8 | ## Konsep 9 | 10 | Untuk mencapai tujuan di atas, berikut adalah konsep yang akan diterapkan pada sistem ini : 11 | 12 | - [x] Setiap user dapat mendaftar. 13 | - [x] Setiap user dapat membuat grup arisan (satu atau lebih). 14 | - [x] Setiap grup arisan dapat diisi sejumlah anggota (user) dengan kapasitas tertentu (limit 20 anggota). 15 | - [x] Satu user boleh sebagai lebih dari 1 anggota di dalam satu grup. 16 | - [x] Setiap grup arisan ada list pertemuan sesuai jumlah anggota. 17 | - [x] Setiap grup ada pengaturan currency/mata uang, jumlah iuran arisan, dan kapasitas anggota. 18 | - [ ] Setiap satu pertemuan ada tanggal, tempat, nama anggota yg dapat arisan, rekening yang dapat arisan, list anggota belum bayar iuran. 19 | - [ ] Pada list pembayaran ada jumlah yang dibayar, tanggal, user tujuan bayar (dibayar ke siapa), cara bayar. 20 | 21 | Sementara itu dulu konsepnya, jika ada perkembangan, akan diupdate kembali. 22 | 23 | ## Cara Install 24 | 25 | #### Spesifikasi minimum server 26 | 1. PHP 7.2 (dan memenuhi [server requirement Laravel 5.5](https://laravel.com/docs/5.5#server-requirements)), 27 | 2. MySQL 5.7 atau MariaDB 10.2, 28 | 3. SQlite (untuk automated testing). 29 | 30 | > Jika menggunakan MySQL < 5.7 atau MariaDB < 10.2, silakan [cek solusi ini](https://github.com/nafiesl/arisan/issues/2#issuecomment-392324454). 31 | 32 | #### Tahap Install 33 | 34 | 1. Clone Repo, pada terminal : `$ git clone https://github.com/nafiesl/arisan.git nama-folder` 35 | 2. `$ cd arisan` 36 | 3. `$ composer install` 37 | 4. `$ cp .env.example .env` (Duplikat file `.env.example` menjadi `.env`) 38 | 5. `$ php artisan key:generate` 39 | 6. Buat **database pada mysql** untuk aplikasi ini 40 | 7. **Setting database** pada file `.env` 41 | 8. `$ php artisan migrate` 42 | 9. `$ php artisan serve` 43 | 10. Selesai (Register user baru untuk mulai mengisi arisan). 44 | 45 | ## Testing 46 | 47 | ```bash 48 | $ vendor/bin/phpunit 49 | ``` 50 | 51 | ## Screenshot 52 | 53 | #### Dashboard 54 | 55 | Setiap member/anggota grup yang login akan melihat daftar grup arisan, dengan list tunggakan pembayaran per grupnya. 56 | 57 | ![Dashboard Arisan](public/screenshots/dashboard-01.jpg) 58 | 59 | #### Detail Grup Arisan 60 | 61 | Setiap member dapat melihat detail grup arisan yang diikutinya. 62 | 63 | ![Dashboard Arisan](public/screenshots/group-detail-01.jpg) 64 | 65 | #### List Pertemuan Grup 66 | 67 | ![Dashboard Arisan](public/screenshots/group-meeting-list-01.jpg) 68 | 69 | #### List Pembayaran Terlambat Grup 70 | 71 | ![Dashboard Arisan](public/screenshots/group-outstanding-payments-01.jpg) 72 | 73 | #### List Anggota Grup 74 | 75 | ![Dashboard Arisan](public/screenshots/group-members-01.jpg) 76 | 77 | 78 | ## Lisensi 79 | 80 | Project Arisan merupakan software free dan open source di bawah [lisensi MIT](LICENSE). -------------------------------------------------------------------------------- /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 | name, [$this], [ 19 | 'title' => trans( 20 | 'app.show_detail_title', 21 | ['name' => $this->name, 'type' => trans('group.group')] 22 | ), 23 | ]); 24 | } 25 | 26 | public function members() 27 | { 28 | return $this->belongsToMany(User::class, 'group_members')->withPivot(['id']); 29 | } 30 | 31 | public function addMember(User $user) 32 | { 33 | if ($this->members()->count() < $this->capacity) { 34 | $this->members()->attach($user); 35 | 36 | return $user; 37 | } 38 | 39 | return false; 40 | } 41 | 42 | public function isFull() 43 | { 44 | return $this->capacity == $this->members->count(); 45 | } 46 | 47 | public function removeMember(int $groupMemberId) 48 | { 49 | return \DB::table('group_members')->delete($groupMemberId); 50 | } 51 | 52 | public function creator() 53 | { 54 | return $this->belongsTo(User::class); 55 | } 56 | 57 | public function getStatusCodeAttribute() 58 | { 59 | if ($this->isActive()) { 60 | return 'active'; 61 | } 62 | 63 | if ($this->isClosed()) { 64 | return 'closed'; 65 | } 66 | 67 | return 'planned'; 68 | } 69 | 70 | public function getStatusAttribute() 71 | { 72 | return trans('group.'.$this->status_code); 73 | } 74 | 75 | public function isPlanned() 76 | { 77 | return is_null($this->start_date) && is_null($this->end_date); 78 | } 79 | 80 | public function isActive() 81 | { 82 | return $this->start_date && is_null($this->end_date); 83 | } 84 | 85 | public function isClosed() 86 | { 87 | return $this->start_date && $this->end_date; 88 | } 89 | 90 | public function meetings() 91 | { 92 | return $this->hasMany(Meeting::class); 93 | } 94 | 95 | public function getWinnerPayoffAttribute() 96 | { 97 | return $this->members->count() * $this->payment_amount; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /app/Helpers/functions.php: -------------------------------------------------------------------------------- 1 | flash('flash_notification.message', $message); 16 | $session->flash('flash_notification.level', $level); 17 | } 18 | } 19 | 20 | /** 21 | * Indonesian Number Format. 22 | * 23 | * @param int $number 24 | * 25 | * @return string Number in Indonesian format. 26 | */ 27 | function formatNo($number) 28 | { 29 | return number_format($number, 0, ',', '.'); 30 | } 31 | 32 | /** 33 | * Rupiah Format. 34 | * 35 | * @param int $number Money in integer format. 36 | * 37 | * @return string Money in string format. 38 | */ 39 | function formatRp($number) 40 | { 41 | if ($number == 0) { 42 | return '-'; 43 | } 44 | 45 | return 'Rp. '.formatNo($number); 46 | } 47 | 48 | /** 49 | * Indonesian Decimal Format. 50 | * 51 | * @param float $number Decimal number in Indonesian format. 52 | * 53 | * @return string Decimal number in Indonesian format. 54 | */ 55 | function formatDecimal($number) 56 | { 57 | return number_format($number, 2, ',', '.'); 58 | } 59 | 60 | /** 61 | * Convert file size to have unit string. 62 | * 63 | * @param int $bytes File size. 64 | * 65 | * @return string Converted file size with unit. 66 | */ 67 | function formatSizeUnits($bytes) 68 | { 69 | if ($bytes >= 1073741824) { 70 | $bytes = number_format($bytes / 1073741824, 2).' GB'; 71 | } elseif ($bytes >= 1048576) { 72 | $bytes = number_format($bytes / 1048576, 2).' MB'; 73 | } elseif ($bytes >= 1024) { 74 | $bytes = number_format($bytes / 1024, 2).' KB'; 75 | } elseif ($bytes > 1) { 76 | $bytes = $bytes.' bytes'; 77 | } elseif ($bytes == 1) { 78 | $bytes = $bytes.' byte'; 79 | } else { 80 | $bytes = '0 bytes'; 81 | } 82 | 83 | return $bytes; 84 | } 85 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ChangePasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 18 | } 19 | 20 | public function show() 21 | { 22 | return view('auth.passwords.change'); 23 | } 24 | 25 | protected function update(Request $request) 26 | { 27 | $input = $request->validate([ 28 | 'old_password' => 'required', 29 | 'password' => 'required|between:6,15|confirmed', 30 | 'password_confirmation' => 'required', 31 | ], [ 32 | 'old_password.required' => 'Password lama harus diisi.', 33 | 'password.required' => 'Password baru harus diisi.', 34 | 'password.between' => 'Password baru harus antara 6 - 15 karakter.', 35 | 'password.confirmed' => 'Konfirmasi password baru tidak sesuai.', 36 | 'password_confirmation.required' => 'Konfirmasi password baru harus diisi.', 37 | ]); 38 | 39 | if (app('hash')->check($input['old_password'], auth()->user()->password)) { 40 | $user = auth()->user(); 41 | $user->password = bcrypt($input['password']); 42 | $user->save(); 43 | 44 | flash(trans('auth.password_changed'), 'success'); 45 | 46 | return back(); 47 | } 48 | 49 | flash(trans('auth.old_password_failed'), 'error'); 50 | 51 | return back(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 39 | } 40 | 41 | /** 42 | * The user has been authenticated. 43 | * 44 | * @param \Illuminate\Http\Request $request 45 | * @param mixed $user 46 | * @return mixed 47 | */ 48 | protected function authenticated(Request $request, $user) 49 | { 50 | if ($user->is_active == 0) { 51 | $this->guard()->logout(); 52 | $request->session()->flush(); 53 | $request->session()->regenerate(); 54 | 55 | flash(trans('auth.user_inactive'), 'error'); 56 | 57 | return redirect()->route('login'); 58 | } 59 | 60 | flash(trans('auth.welcome', ['name' => $user->name])); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 40 | } 41 | 42 | /** 43 | * Get a validator for an incoming registration request. 44 | * 45 | * @param array $data 46 | * @return \Illuminate\Contracts\Validation\Validator 47 | */ 48 | protected function validator(array $data) 49 | { 50 | return Validator::make($data, [ 51 | 'name' => 'required|string|max:255', 52 | 'email' => 'required|string|email|max:255|unique:users', 53 | 'password' => 'required|string|min:6|confirmed', 54 | ]); 55 | } 56 | 57 | /** 58 | * Create a new user instance after a valid registration. 59 | * 60 | * @param array $data 61 | * @return \App\User 62 | */ 63 | protected function create(array $data) 64 | { 65 | return User::create([ 66 | 'name' => $data['name'], 67 | 'email' => $data['email'], 68 | 'password' => bcrypt($data['password']), 69 | ]); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | user()->groups; 17 | $membershipIds = []; 18 | foreach ($groups as $group) { 19 | $membershipIds[$group->id] = $group->pivot->id; 20 | } 21 | $outstandingPayments = $this->getUserOutstandingPayments(auth()->user()); 22 | 23 | return view('home', compact('groups', 'membershipIds', 'outstandingPayments')); 24 | } 25 | 26 | public function getUserOutstandingPayments(User $user) 27 | { 28 | $userGroups = $user->groups->load('meetings.payments'); 29 | $meetings = $userGroups->pluck('meetings')->flatten()->sortBy('number'); 30 | 31 | return $meetings; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Controllers/Groups/MeetingsController.php: -------------------------------------------------------------------------------- 1 | meetings; 15 | $number = (int) request('number'); 16 | $acceptableNumber = $this->getAcceptableGroupMeetingNumber($group, $number); 17 | 18 | return view('groups.meetings', compact('group', 'meetings', 'acceptableNumber')); 19 | } 20 | 21 | public function store(Request $request, Group $group) 22 | { 23 | $this->authorize('update', $group); 24 | 25 | $newMeeting = $request->validate([ 26 | 'number' => 'required|numeric|max:'.$group->members()->count(), 27 | 'date' => 'required|date|date_format:Y-m-d', 28 | 'place' => 'nullable|string|max:255', 29 | 'notes' => 'nullable|string|max:255', 30 | ]); 31 | $newMeeting['group_id'] = $group->id; 32 | $newMeeting['creator_id'] = auth()->id(); 33 | 34 | Meeting::create($newMeeting); 35 | 36 | flash(__('meeting.created', [ 37 | 'number' => $newMeeting['number'], 38 | 'date' => $newMeeting['date'], 39 | 'place' => $newMeeting['place'], 40 | ]), 'success'); 41 | 42 | return redirect()->route('groups.meetings.index', $group); 43 | } 44 | 45 | private function getAcceptableGroupMeetingNumber(Group $group, $number) 46 | { 47 | $groupMembersCount = $group->members()->count(); 48 | $existingMeetingNumbers = $group->meetings->pluck('number')->all(); 49 | 50 | if ($number && $number <= $groupMembersCount && !in_array($number, $existingMeetingNumbers)) { 51 | return $number; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/Http/Controllers/Groups/MembersController.php: -------------------------------------------------------------------------------- 1 | meetings; 15 | 16 | return view('groups.members', compact('group', 'meetings')); 17 | } 18 | 19 | public function store(Request $request, Group $group) 20 | { 21 | $userData = $request->validate([ 22 | 'email' => 'required|email', 23 | ]); 24 | 25 | $user = User::firstOrNew(['email' => $userData['email']]); 26 | 27 | if (!$user->exists) { 28 | $newUserName = explode('@', $userData['email']); 29 | $user->name = $newUserName[0]; 30 | $user->password = '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm'; 31 | $user->save(); 32 | } 33 | 34 | if ($group->addMember($user) == false) { 35 | flash(__('group.member_add_failed'), 'error'); 36 | } else { 37 | flash(__('group.member_added', ['name' => $user->name]), 'success'); 38 | } 39 | 40 | return back(); 41 | } 42 | 43 | public function destroy(Request $request, Group $group, User $member) 44 | { 45 | $request->validate([ 46 | 'group_member_id' => 'required|numeric|exists:group_members,id', 47 | ]); 48 | $group->removeMember($request->get('group_member_id')); 49 | 50 | flash(__('group.member_removed', ['name' => $member->name]), 'warning'); 51 | 52 | return back(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/Http/Controllers/Groups/PaymentsController.php: -------------------------------------------------------------------------------- 1 | members; 13 | $meetings = $group->meetings()->whereNotNull('winner_id')->orderBy('number')->get(); 14 | 15 | return view('groups.outstanding-payments', compact('group', 'members', 'meetings')); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Controllers/GroupsController.php: -------------------------------------------------------------------------------- 1 | where('name', 'like', '%'.request('q').'%'); 19 | }) 20 | ->where('creator_id', auth()->id()) 21 | ->withCount('members') 22 | ->paginate(); 23 | 24 | return view('groups.index', compact('groups')); 25 | } 26 | 27 | /** 28 | * Show the form for creating a new group. 29 | * 30 | * @return \Illuminate\Http\Response 31 | */ 32 | public function create() 33 | { 34 | $this->authorize('create', new Group); 35 | 36 | return view('groups.create'); 37 | } 38 | 39 | /** 40 | * Store a newly created group in storage. 41 | * 42 | * @param \Illuminate\Http\Request $request 43 | * @return \Illuminate\Http\Response 44 | */ 45 | public function store(Request $request) 46 | { 47 | $this->authorize('create', new Group); 48 | 49 | $newGroup = $request->validate([ 50 | 'name' => 'required|max:60', 51 | 'capacity' => 'required|numeric', 52 | 'currency' => 'required|string', 53 | 'payment_amount' => 'required|numeric', 54 | 'description' => 'nullable|max:255', 55 | ]); 56 | $newGroup['creator_id'] = auth()->id(); 57 | 58 | $group = Group::create($newGroup); 59 | 60 | return redirect()->route('groups.show', $group); 61 | } 62 | 63 | /** 64 | * Display the specified group. 65 | * 66 | * @param \App\Group $group 67 | * @return \Illuminate\Http\Response 68 | */ 69 | public function show(Group $group) 70 | { 71 | $this->authorize('view', $group); 72 | 73 | return view('groups.show', compact('group')); 74 | } 75 | 76 | /** 77 | * Show the form for editing the specified group. 78 | * 79 | * @param \App\Group $group 80 | * @return \Illuminate\Http\Response 81 | */ 82 | public function edit(Group $group) 83 | { 84 | $this->authorize('update', $group); 85 | 86 | return view('groups.edit', compact('group')); 87 | } 88 | 89 | /** 90 | * Update the specified group in storage. 91 | * 92 | * @param \Illuminate\Http\Request $request 93 | * @param \App\Group $group 94 | * @return \Illuminate\Http\Response 95 | */ 96 | public function update(Request $request, Group $group) 97 | { 98 | $this->authorize('update', $group); 99 | 100 | $groupData = $request->validate([ 101 | 'name' => 'required|max:60', 102 | 'capacity' => 'required|numeric', 103 | 'currency' => 'required|string', 104 | 'payment_amount' => 'required|numeric', 105 | 'start_date' => 'nullable|date|date_format:Y-m-d', 106 | 'end_date' => 'nullable|date|date_format:Y-m-d', 107 | 'description' => 'nullable|max:255', 108 | ]); 109 | 110 | $group->update($groupData); 111 | 112 | return redirect()->route('groups.show', $group); 113 | } 114 | 115 | /** 116 | * Remove the specified group from storage. 117 | * 118 | * @param \App\Group $group 119 | * @return \Illuminate\Http\Response 120 | */ 121 | public function destroy(Group $group) 122 | { 123 | $this->authorize('delete', $group); 124 | 125 | $this->validate(request(), [ 126 | 'group_id' => 'required', 127 | ]); 128 | 129 | $routeParam = request()->only('page', 'q'); 130 | 131 | if (request('group_id') == $group->id && $group->delete()) { 132 | return redirect()->route('groups.index', $routeParam); 133 | } 134 | 135 | return back(); 136 | } 137 | 138 | public function setStartDate(Request $request, Group $group) 139 | { 140 | $this->authorize('update', $group); 141 | $request->validate(['start_date' => 'required|date|date_format:Y-m-d']); 142 | 143 | $group->start_date = $request->get('start_date'); 144 | $group->save(); 145 | 146 | flash(trans('group.started'), 'success'); 147 | 148 | return back(); 149 | } 150 | 151 | public function setEndDate(Request $request, Group $group) 152 | { 153 | $this->authorize('update', $group); 154 | $request->validate(['end_date' => 'required|date|date_format:Y-m-d']); 155 | 156 | $group->end_date = $request->get('end_date'); 157 | $group->save(); 158 | 159 | flash(trans('group.ended'), 'success'); 160 | 161 | return back(); 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /app/Http/Controllers/MeetingsController.php: -------------------------------------------------------------------------------- 1 | group; 16 | $members = $group->members; 17 | $payments = $meeting->payments; 18 | $winnerCadidateList = $this->getWinnerCandidates($meeting, $members); 19 | 20 | return view('meetings.show', compact('meeting', 'group', 'members', 'payments', 'winnerCadidateList')); 21 | } 22 | 23 | private function getWinnerCandidates(Meeting $meeting, Collection $members) 24 | { 25 | $winnerCandidateList = []; 26 | 27 | $winnerMemberIds = Meeting::where('id', '!=', $meeting->id)->pluck('winner_id')->all(); 28 | 29 | foreach ($members as $member) { 30 | $memberId = $member->pivot->id; 31 | 32 | if (in_array($memberId, $winnerMemberIds) == false) { 33 | $winnerCandidateList[$memberId] = $member->name; 34 | } 35 | } 36 | 37 | return $winnerCandidateList; 38 | } 39 | 40 | public function update(Request $request, Meeting $meeting) 41 | { 42 | $this->authorize('update', $meeting->group); 43 | 44 | $meetingData = $request->validate([ 45 | 'date' => 'required|date|date_format:Y-m-d', 46 | 'place' => 'nullable|string|max:255', 47 | 'notes' => 'nullable|string|max:255', 48 | ]); 49 | 50 | $meeting->update($meetingData); 51 | 52 | flash(__('meeting.updated', [ 53 | 'number' => $meeting->number, 54 | 'date' => $meetingData['date'], 55 | 'place' => $meetingData['place'], 56 | ]), 'success'); 57 | 58 | return redirect()->route('meetings.show', $meeting); 59 | } 60 | 61 | public function paymentEntry(Request $request, Meeting $meeting) 62 | { 63 | $this->authorize('update', $meeting->group); 64 | 65 | $paymentData = $request->validate([ 66 | 'membership_id' => 'required|numeric|exists:group_members,id', 67 | 'amount' => 'required|numeric', 68 | 'date' => 'required|date|date_format:Y-m-d', 69 | 'payment_receiver_id' => 'required|numeric|exists:users,id', 70 | ]); 71 | 72 | $payment = Payment::firstOrNew([ 73 | 'membership_id' => $paymentData['membership_id'], 74 | 'meeting_id' => $meeting->id, 75 | ]); 76 | 77 | $payment->amount = $paymentData['amount']; 78 | $payment->date = $paymentData['date']; 79 | $payment->payment_receiver_id = $paymentData['payment_receiver_id']; 80 | $payment->creator_id = auth()->id(); 81 | $payment->save(); 82 | 83 | flash(__('payment.updated'), 'success'); 84 | 85 | return back(); 86 | } 87 | 88 | public function setWinner(Request $request, Meeting $meeting) 89 | { 90 | $winnerData = $request->validate(['winner_id' => 'required|numeric|exists:group_members,id']); 91 | 92 | $meeting->winner_id = $winnerData['winner_id']; 93 | $meeting->save(); 94 | 95 | $userId = \DB::table('group_members')->where('id', $winnerData['winner_id'])->first()->user_id; 96 | $user = User::find($userId); 97 | 98 | flash(__('meeting.winner_set', ['name' => $user->name]), 'success'); 99 | 100 | return redirect()->route('meetings.show', $meeting); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /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' => \Illuminate\Auth\Middleware\Authenticate::class, 55 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 56 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 57 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 58 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 59 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 60 | ]; 61 | } 62 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 'FORWARDED', 24 | Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR', 25 | Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST', 26 | Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT', 27 | Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO', 28 | ]; 29 | } 30 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | belongsTo(Group::class); 18 | } 19 | 20 | public function creator() 21 | { 22 | return $this->belongsTo(User::class); 23 | } 24 | 25 | public function winner() 26 | { 27 | return $this->belongsTo(Membership::class)->withDefault(['user' => '-']); 28 | } 29 | 30 | public function payments() 31 | { 32 | return $this->hasMany(Payment::class); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Membership.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/Payment.php: -------------------------------------------------------------------------------- 1 | creator_id == $user->id || $group->members->contains($user->id); 24 | } 25 | 26 | /** 27 | * Determine whether the user can create projects. 28 | * 29 | * @param \App\User $user 30 | * @param \App\Group $group 31 | * @return mixed 32 | */ 33 | public function create(User $user, Group $group) 34 | { 35 | // Update $user authorization to create $group here. 36 | return true; 37 | } 38 | 39 | /** 40 | * Determine whether the user can update the project. 41 | * 42 | * @param \App\User $user 43 | * @param \App\Group $group 44 | * @return mixed 45 | */ 46 | public function update(User $user, Group $group) 47 | { 48 | // Update $user authorization to update $group here. 49 | return $user->id == $group->creator_id; 50 | } 51 | 52 | /** 53 | * Determine whether the user can delete the project. 54 | * 55 | * @param \App\User $user 56 | * @param \App\Group $group 57 | * @return mixed 58 | */ 59 | public function delete(User $user, Group $group) 60 | { 61 | // Update $user authorization to delete $group here. 62 | return $user->id == $group->creator_id; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\GroupPolicy', 16 | 'App\Model' => '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 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | parent::boot(); 29 | 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /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/User.php: -------------------------------------------------------------------------------- 1 | belongsToMany(Group::class, 'group_members')->withPivot(['id']); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /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 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": "^7.2", 9 | "fideloper/proxy": "~3.3", 10 | "laravel/framework": "5.5.*", 11 | "laravel/tinker": "~1.0", 12 | "luthfi/formfield": "^0.2.7" 13 | }, 14 | "require-dev": { 15 | "barryvdh/laravel-debugbar": "^3.1", 16 | "filp/whoops": "~2.0", 17 | "fzaninotto/faker": "~1.4", 18 | "luthfi/simple-crud-generator": "^1.1", 19 | "mockery/mockery": "~1.0", 20 | "phpunit/phpunit": "~6.0" 21 | }, 22 | "autoload": { 23 | "classmap": [ 24 | "database/seeds", 25 | "database/factories" 26 | ], 27 | "psr-4": { 28 | "App\\": "app/" 29 | } 30 | }, 31 | "autoload-dev": { 32 | "psr-4": { 33 | "Tests\\": "tests/" 34 | } 35 | }, 36 | "extra": { 37 | "laravel": { 38 | "dont-discover": [ 39 | ] 40 | } 41 | }, 42 | "scripts": { 43 | "post-root-package-install": [ 44 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 45 | ], 46 | "post-create-project-cmd": [ 47 | "@php artisan key:generate" 48 | ], 49 | "post-autoload-dump": [ 50 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 51 | "@php artisan package:discover" 52 | ] 53 | }, 54 | "config": { 55 | "preferred-install": "dist", 56 | "sort-packages": true, 57 | "optimize-autoloader": true 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /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 | ], 48 | ], 49 | 50 | /* 51 | |-------------------------------------------------------------------------- 52 | | User Providers 53 | |-------------------------------------------------------------------------- 54 | | 55 | | All authentication drivers have a user provider. This defines how the 56 | | users are actually retrieved out of your database or other storage 57 | | mechanisms used by this application to persist your user's data. 58 | | 59 | | If you have multiple user tables or models you may configure multiple 60 | | sources which represent each model / table. These sources may then 61 | | be assigned to any extra authentication guards you have defined. 62 | | 63 | | Supported: "database", "eloquent" 64 | | 65 | */ 66 | 67 | 'providers' => [ 68 | 'users' => [ 69 | 'driver' => 'eloquent', 70 | 'model' => App\User::class, 71 | ], 72 | 73 | // 'users' => [ 74 | // 'driver' => 'database', 75 | // 'table' => 'users', 76 | // ], 77 | ], 78 | 79 | /* 80 | |-------------------------------------------------------------------------- 81 | | Resetting Passwords 82 | |-------------------------------------------------------------------------- 83 | | 84 | | You may specify multiple password reset configurations if you have more 85 | | than one user table or model in the application and you want to have 86 | | separate password reset settings based on the specific user types. 87 | | 88 | | The expire time is the number of minutes that the reset token should be 89 | | considered valid. This security feature keeps tokens short-lived so 90 | | they have less time to be guessed. You may change this as needed. 91 | | 92 | */ 93 | 94 | 'passwords' => [ 95 | 'users' => [ 96 | 'provider' => 'users', 97 | 'table' => 'password_resets', 98 | 'expire' => 60, 99 | ], 100 | ], 101 | 102 | ]; 103 | -------------------------------------------------------------------------------- /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'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | */ 30 | 31 | 'stores' => [ 32 | 33 | 'apc' => [ 34 | 'driver' => 'apc', 35 | ], 36 | 37 | 'array' => [ 38 | 'driver' => 'array', 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => 'cache', 44 | 'connection' => null, 45 | ], 46 | 47 | 'file' => [ 48 | 'driver' => 'file', 49 | 'path' => storage_path('framework/cache/data'), 50 | ], 51 | 52 | 'memcached' => [ 53 | 'driver' => 'memcached', 54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 55 | 'sasl' => [ 56 | env('MEMCACHED_USERNAME'), 57 | env('MEMCACHED_PASSWORD'), 58 | ], 59 | 'options' => [ 60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 61 | ], 62 | 'servers' => [ 63 | [ 64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 65 | 'port' => env('MEMCACHED_PORT', 11211), 66 | 'weight' => 100, 67 | ], 68 | ], 69 | ], 70 | 71 | 'redis' => [ 72 | 'driver' => 'redis', 73 | 'connection' => 'default', 74 | ], 75 | 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Cache Key Prefix 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When utilizing a RAM based store such as APC or Memcached, there might 84 | | be other applications utilizing the same cache. So, we'll specify a 85 | | value to get prefixed to all our keys so we can avoid collisions. 86 | | 87 | */ 88 | 89 | 'prefix' => env( 90 | 'CACHE_PREFIX', 91 | str_slug(env('APP_NAME', 'laravel'), '_').'_cache' 92 | ), 93 | 94 | ]; 95 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Database Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here are each of the database connections setup for your application. 24 | | Of course, examples of configuring each database platform that is 25 | | supported by Laravel is shown below to make development simple. 26 | | 27 | | 28 | | All database work in Laravel is done through the PHP PDO facilities 29 | | so make sure you have the driver for your particular database of 30 | | choice installed on your machine before you begin development. 31 | | 32 | */ 33 | 34 | 'connections' => [ 35 | 36 | 'sqlite' => [ 37 | 'driver' => 'sqlite', 38 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 39 | 'prefix' => '', 40 | ], 41 | 42 | 'mysql' => [ 43 | 'driver' => 'mysql', 44 | 'host' => env('DB_HOST', '127.0.0.1'), 45 | 'port' => env('DB_PORT', '3306'), 46 | 'database' => env('DB_DATABASE', 'forge'), 47 | 'username' => env('DB_USERNAME', 'forge'), 48 | 'password' => env('DB_PASSWORD', ''), 49 | 'unix_socket' => env('DB_SOCKET', ''), 50 | 'charset' => 'utf8mb4', 51 | 'collation' => 'utf8mb4_unicode_ci', 52 | 'prefix' => '', 53 | 'strict' => true, 54 | 'engine' => null, 55 | ], 56 | 57 | 'pgsql' => [ 58 | 'driver' => 'pgsql', 59 | 'host' => env('DB_HOST', '127.0.0.1'), 60 | 'port' => env('DB_PORT', '5432'), 61 | 'database' => env('DB_DATABASE', 'forge'), 62 | 'username' => env('DB_USERNAME', 'forge'), 63 | 'password' => env('DB_PASSWORD', ''), 64 | 'charset' => 'utf8', 65 | 'prefix' => '', 66 | 'schema' => 'public', 67 | 'sslmode' => 'prefer', 68 | ], 69 | 70 | 'sqlsrv' => [ 71 | 'driver' => 'sqlsrv', 72 | 'host' => env('DB_HOST', 'localhost'), 73 | 'port' => env('DB_PORT', '1433'), 74 | 'database' => env('DB_DATABASE', 'forge'), 75 | 'username' => env('DB_USERNAME', 'forge'), 76 | 'password' => env('DB_PASSWORD', ''), 77 | 'charset' => 'utf8', 78 | 'prefix' => '', 79 | ], 80 | 81 | ], 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Migration Repository Table 86 | |-------------------------------------------------------------------------- 87 | | 88 | | This table keeps track of all the migrations that have already run for 89 | | your application. Using this information, we can determine which of 90 | | the migrations on disk haven't actually been run in the database. 91 | | 92 | */ 93 | 94 | 'migrations' => 'migrations', 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Redis Databases 99 | |-------------------------------------------------------------------------- 100 | | 101 | | Redis is an open source, fast, and advanced key-value store that also 102 | | provides a richer set of commands than a typical key-value systems 103 | | such as APC or Memcached. Laravel makes it easy to dig right in. 104 | | 105 | */ 106 | 107 | 'redis' => [ 108 | 109 | 'client' => 'predis', 110 | 111 | 'default' => [ 112 | 'host' => env('REDIS_HOST', '127.0.0.1'), 113 | 'password' => env('REDIS_PASSWORD', null), 114 | 'port' => env('REDIS_PORT', 6379), 115 | 'database' => 0, 116 | ], 117 | 118 | ], 119 | 120 | ]; 121 | -------------------------------------------------------------------------------- /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", "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 | ], 65 | 66 | ], 67 | 68 | ]; 69 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | SMTP Host Address 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may provide the host address of the SMTP server used by your 27 | | applications. A default option is provided that is compatible with 28 | | the Mailgun mail service which will provide reliable deliveries. 29 | | 30 | */ 31 | 32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | SMTP Host Port 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This is the SMTP port used by your application to deliver e-mails to 40 | | users of the application. Like the host we have set this value to 41 | | stay compatible with the Mailgun e-mail application by default. 42 | | 43 | */ 44 | 45 | 'port' => env('MAIL_PORT', 587), 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Global "From" Address 50 | |-------------------------------------------------------------------------- 51 | | 52 | | You may wish for all e-mails sent by your application to be sent from 53 | | the same address. Here, you may specify a name and address that is 54 | | used globally for all e-mails that are sent by your application. 55 | | 56 | */ 57 | 58 | 'from' => [ 59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 60 | 'name' => env('MAIL_FROM_NAME', 'Example'), 61 | ], 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | E-Mail Encryption Protocol 66 | |-------------------------------------------------------------------------- 67 | | 68 | | Here you may specify the encryption protocol that should be used when 69 | | the application send e-mail messages. A sensible default using the 70 | | transport layer security protocol should provide great security. 71 | | 72 | */ 73 | 74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | SMTP Server Username 79 | |-------------------------------------------------------------------------- 80 | | 81 | | If your SMTP server requires a username for authentication, you should 82 | | set it here. This will get used to authenticate with your server on 83 | | connection. You may also set the "password" value below this one. 84 | | 85 | */ 86 | 87 | 'username' => env('MAIL_USERNAME'), 88 | 89 | 'password' => env('MAIL_PASSWORD'), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Sendmail System Path 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When using the "sendmail" driver to send e-mails, we will need to know 97 | | the path to where Sendmail lives on this server. A default path has 98 | | been provided here, which will work well on most of your systems. 99 | | 100 | */ 101 | 102 | 'sendmail' => '/usr/sbin/sendmail -bs', 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Markdown Mail Settings 107 | |-------------------------------------------------------------------------- 108 | | 109 | | If you are using Markdown based email rendering, you may configure your 110 | | theme and component paths here, allowing you to customize the design 111 | | of the emails. Or, you may simply stick with the Laravel defaults! 112 | | 113 | */ 114 | 115 | 'markdown' => [ 116 | 'theme' => 'default', 117 | 118 | 'paths' => [ 119 | resource_path('views/vendor/mail'), 120 | ], 121 | ], 122 | 123 | ]; 124 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 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 | ], 50 | 51 | 'sqs' => [ 52 | 'driver' => 'sqs', 53 | 'key' => env('SQS_KEY', 'your-public-key'), 54 | 'secret' => env('SQS_SECRET', 'your-secret-key'), 55 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 56 | 'queue' => env('SQS_QUEUE', 'your-queue-name'), 57 | 'region' => env('SQS_REGION', 'us-east-1'), 58 | ], 59 | 60 | 'redis' => [ 61 | 'driver' => 'redis', 62 | 'connection' => 'default', 63 | 'queue' => 'default', 64 | 'retry_after' => 90, 65 | ], 66 | 67 | ], 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Failed Queue Jobs 72 | |-------------------------------------------------------------------------- 73 | | 74 | | These options configure the behavior of failed queue job logging so you 75 | | can control which database and table are used to store the jobs that 76 | | have failed. You may change them to any database / table you wish. 77 | | 78 | */ 79 | 80 | 'failed' => [ 81 | 'database' => env('DB_CONNECTION', 'mysql'), 82 | 'table' => 'failed_jobs', 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/simple-crud.php: -------------------------------------------------------------------------------- 1 | 'layouts.app', 15 | 16 | /* 17 | |-------------------------------------------------------------------------- 18 | | Base Test Class Path 19 | |-------------------------------------------------------------------------- 20 | | 21 | | Base TestCase Path on Laravel application 22 | | 23 | */ 24 | 25 | 'base_test_path' => 'tests/TestCase.php', 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Base Test Class 30 | |-------------------------------------------------------------------------- 31 | | 32 | | Base Test Class that used on Laravel application 33 | | according to 'base_test_path' config above 34 | | 35 | */ 36 | 37 | 'base_test_class' => 'Tests\TestCase', 38 | 39 | ]; 40 | -------------------------------------------------------------------------------- /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' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/factories/GroupFactory.php: -------------------------------------------------------------------------------- 1 | define(Group::class, function (Faker $faker) { 8 | return [ 9 | 'name' => $faker->words(2, true), 10 | 'capacity' => 20, 11 | 'currency' => 'IDR', 12 | 'payment_amount' => 50000, 13 | 'description' => $faker->sentence, 14 | 'creator_id' => function () { 15 | return factory(User::class)->create()->id; 16 | }, 17 | ]; 18 | }); 19 | -------------------------------------------------------------------------------- /database/factories/MeetingFactory.php: -------------------------------------------------------------------------------- 1 | define(Meeting::class, function (Faker $faker) { 9 | return [ 10 | 'group_id' => function () { 11 | return factory(Group::class)->create()->id; 12 | }, 13 | 'number' => 1, 14 | 'date' => today(), 15 | 'place' => 'Inter Cafe', 16 | 'creator_id' => function () { 17 | return factory(User::class)->create()->id; 18 | }, 19 | ]; 20 | }); 21 | -------------------------------------------------------------------------------- /database/factories/PaymentFactory.php: -------------------------------------------------------------------------------- 1 | define(Payment::class, function (Faker $faker) { 9 | return [ 10 | 'membership_id' => 1, 11 | 'meeting_id' => function () { 12 | return factory(Meeting::class)->create()->id; 13 | }, 14 | 'amount' => 999, 15 | 'date' => today(), 16 | 'payment_receiver_id' => function () { 17 | return factory(User::class)->create()->id; 18 | }, 19 | 'creator_id' => function () { 20 | return factory(User::class)->create()->id; 21 | }, 22 | ]; 23 | }); 24 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker $faker) { 17 | return [ 18 | 'name' => $faker->name, 19 | 'email' => $faker->unique()->safeEmail, 20 | 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret 21 | 'remember_token' => str_random(10), 22 | ]; 23 | }); 24 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->string('password'); 21 | $table->boolean('is_active')->default(1); 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('users'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /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/2018_04_26_195126_create_groups_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name', 60); 19 | $table->unsignedTinyInteger('capacity'); 20 | $table->string('currency', 10); 21 | $table->unsignedInteger('payment_amount'); 22 | $table->string('description')->nullable(); 23 | $table->date('start_date')->nullable(); 24 | $table->date('end_date')->nullable(); 25 | $table->unsignedInteger('creator_id'); 26 | $table->timestamps(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::dropIfExists('groups'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /database/migrations/2018_04_27_103238_create_group_members_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->unsignedInteger('group_id'); 19 | $table->unsignedInteger('user_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('group_members'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2018_04_29_171702_create_meetings_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->unsignedInteger('group_id'); 19 | $table->unsignedInteger('winner_id')->nullable(); 20 | $table->unsignedTinyInteger('number'); 21 | $table->date('date'); 22 | $table->string('place')->nullable(); 23 | $table->string('notes')->nullable(); 24 | $table->unsignedInteger('creator_id'); 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::dropIfExists('meetings'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /database/migrations/2018_05_06_110520_create_payments_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->unsignedInteger('membership_id'); 19 | $table->unsignedInteger('meeting_id'); 20 | $table->unsignedInteger('amount'); 21 | $table->date('date'); 22 | $table->unsignedInteger('payment_receiver_id'); 23 | $table->unsignedInteger('creator_id'); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('payments'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /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": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 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 | "axios": "^0.28", 14 | "bootstrap-sass": "^3.4.1", 15 | "cross-env": "^5.1", 16 | "jquery": "^3.5", 17 | "laravel-mix": "^2.0", 18 | "lodash": "^4.17.21" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Feature 14 | 15 | 16 | 17 | ./tests/Unit 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/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nafiesl/arisan/c0b03f7b81af51110aed6a82011c6a8fff6e326d/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | define('LARAVEL_START', microtime(true)); 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels great to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../vendor/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /public/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/js/app.js": "/js/app.js", 3 | "/css/app.css": "/css/app.css" 4 | } -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/screenshots/dashboard-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nafiesl/arisan/c0b03f7b81af51110aed6a82011c6a8fff6e326d/public/screenshots/dashboard-01.jpg -------------------------------------------------------------------------------- /public/screenshots/group-detail-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nafiesl/arisan/c0b03f7b81af51110aed6a82011c6a8fff6e326d/public/screenshots/group-detail-01.jpg -------------------------------------------------------------------------------- /public/screenshots/group-meeting-list-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nafiesl/arisan/c0b03f7b81af51110aed6a82011c6a8fff6e326d/public/screenshots/group-meeting-list-01.jpg -------------------------------------------------------------------------------- /public/screenshots/group-members-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nafiesl/arisan/c0b03f7b81af51110aed6a82011c6a8fff6e326d/public/screenshots/group-members-01.jpg -------------------------------------------------------------------------------- /public/screenshots/group-outstanding-payments-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nafiesl/arisan/c0b03f7b81af51110aed6a82011c6a8fff6e326d/public/screenshots/group-outstanding-payments-01.jpg -------------------------------------------------------------------------------- /public/screenshots/meeting-detail-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nafiesl/arisan/c0b03f7b81af51110aed6a82011c6a8fff6e326d/public/screenshots/meeting-detail-01.jpg -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * includes Vue and other libraries. It is a great starting point when 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | -------------------------------------------------------------------------------- /resources/assets/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | 4 | /** 5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 6 | * for JavaScript based Bootstrap features such as modals and tabs. This 7 | * code may be modified to fit the specific needs of your application. 8 | */ 9 | 10 | try { 11 | window.$ = window.jQuery = require('jquery'); 12 | 13 | require('bootstrap-sass'); 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: 'your-pusher-key', 53 | // cluster: 'mt1', 54 | // encrypted: true 55 | // }); 56 | -------------------------------------------------------------------------------- /resources/assets/sass/_custom.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Custom css for Laravel 3 | * By Nafies Luthfi 4 | * Code licensed under the MIT License. 5 | * For details, see https://opensource.org/licenses/MIT 6 | */ 7 | 8 | .page-header { 9 | margin: 0 0 22px; 10 | } 11 | 12 | .navbar-toggle { 13 | padding: 5px 10px; 14 | } 15 | 16 | .panel h1, .panel .h1 { 17 | margin-top: 0; 18 | } 19 | 20 | h3.page-header div.pull-right { 21 | margin-top: -8px; 22 | } 23 | 24 | .strong { 25 | font-weight: bold; 26 | } 27 | 28 | /* Form */ 29 | .form-group.required .control-label { 30 | position: relative; 31 | } 32 | 33 | .form-group.required .control-label:after { 34 | content: "*"; 35 | color: red; 36 | font-size: 14px; 37 | position: absolute; 38 | top: -2px; 39 | right: -8px; 40 | } 41 | 42 | /* Table */ 43 | table .text-top { vertical-align: top !important; } 44 | table .text-middle { vertical-align: middle !important; } 45 | table .text-bottom { vertical-align: bottom !important; } 46 | table.small-text { font-size: 12px; } 47 | .panel .table { margin-bottom: 0px; } 48 | .table .form-group { margin-bottom: 0px; } 49 | .table .form-group .form-control { border-radius: 0px; padding: 4px 6px; height: 26px; } 50 | .table .input-group-addon { padding: 5px 10px; } 51 | /* End of Table */ 52 | 53 | // Nav Tabs 54 | .nav.nav-tabs > li > a { 55 | padding: 6px 10px; 56 | } 57 | .nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover { 58 | border-top: 2px solid #f0ad4e; 59 | padding-bottom: 5px; 60 | } 61 | // End of Nav Tabs 62 | 63 | /* Select2 */ 64 | .select2-container .select2-selection--single { height: 36px !important; } 65 | .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 34px !important; } 66 | .select2-container--default .select2-selection--single .select2-selection__arrow { height: 34px !important; } 67 | /* End of Select2 */ 68 | 69 | /* xs-navbar */ 70 | a.xs-navbar { 71 | color: #777; 72 | float: left; 73 | padding: 14px 10px; 74 | font-size: 14px; 75 | line-height: 22px; 76 | height: 50px; 77 | } 78 | a.xs-navbar:hover { 79 | text-decoration: none; 80 | } 81 | /* End of xs-navbar */ -------------------------------------------------------------------------------- /resources/assets/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | 2 | // Body 3 | $body-bg: #f5f8fa; 4 | 5 | // Borders 6 | $laravel-border-color: darken($body-bg, 10%); 7 | $list-group-border: $laravel-border-color; 8 | $navbar-default-border: $laravel-border-color; 9 | $panel-default-border: $laravel-border-color; 10 | $panel-inner-border: $laravel-border-color; 11 | 12 | // Brands 13 | $brand-primary: #3097D1; 14 | $brand-info: #8eb4cb; 15 | $brand-success: #2ab27b; 16 | $brand-warning: #cbb956; 17 | $brand-danger: #bf5329; 18 | 19 | // Typography 20 | $icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/"; 21 | $font-family-sans-serif: "Trebuchet MS", sans-serif; 22 | $font-size-base: 14px; 23 | $line-height-base: 1.6; 24 | $text-color: #636b6f; 25 | 26 | // Navbar 27 | $navbar-default-bg: #fff; 28 | 29 | // Buttons 30 | $btn-default-color: $text-color; 31 | 32 | // Inputs 33 | $input-border: lighten($text-color, 40%); 34 | $input-border-focus: lighten($brand-primary, 25%); 35 | $input-color-placeholder: lighten($text-color, 30%); 36 | 37 | // Panels 38 | $panel-default-heading-bg: #fff; 39 | -------------------------------------------------------------------------------- /resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | // Variables 2 | @import "variables"; 3 | 4 | // Bootstrap 5 | @import "~bootstrap-sass/assets/stylesheets/bootstrap"; 6 | 7 | // Bootstrap Theme 8 | @import "bootstrap-theme"; 9 | 10 | // Custom CSS 11 | @import "custom"; 12 | -------------------------------------------------------------------------------- /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 six 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/lang/id/app.php: -------------------------------------------------------------------------------- 1 | '#', 6 | 'no' => 'Tidak', 7 | 'yes' => 'Ya', 8 | 'label' => 'Label', 9 | 'action' => 'Pilihan', 10 | 'welcome' => 'Selamat Datang', 11 | 'active' => 'Aktif', 12 | 'in_active' => 'Non Aktif', 13 | 'show_detail_title' => 'Lihat detail :type :name', 14 | 'status' => 'Status', 15 | 'type' => 'Jenis', 16 | 'total' => 'Total', 17 | 'count' => 'Jumlah', 18 | 'remark' => 'Keterangan', 19 | 'level' => 'Level', 20 | 'not_available' => 'Tidak Tersedia', 21 | 22 | // Action 23 | 'add' => 'Tambah', 24 | 'submit' => 'Submit', 25 | 'update' => 'Update', 26 | 'delete' => 'Hapus', 27 | 'back' => 'Kembali', 28 | 'cancel' => 'Batal', 29 | 'reset' => 'Reset', 30 | 'show' => 'Lihat Detail', 31 | 'edit' => 'Edit', 32 | 'search' => 'Cari', 33 | 'filter' => 'Filter', 34 | 'pick' => 'Pilih', 35 | 'close' => 'Tutup', 36 | 'delete_confirm_button' => 'Ya, silakan hapus!', 37 | 'delete_confirm' => 'Anda yakin ingin menghapus?', 38 | 'done' => 'Selesai', 39 | 40 | // Attributes 41 | 'name' => 'Nama', 42 | 'notes' => 'Catatan', 43 | 'description' => 'Deskripsi', 44 | 'code' => 'Kode', 45 | 'date' => 'Tanggal', 46 | 'time' => 'Jam', 47 | 'created_at' => 'Dibuat pada', 48 | 'created_by' => 'Oleh', 49 | 'start_date' => 'Tanggal Mulai', 50 | 'end_date' => 'Tanggal Selesai', 51 | 'gender' => 'Jenis Kelamin', 52 | 'gender_male' => 'Laki-laki', 53 | 'gender_female' => 'Perempuan', 54 | 'pob' => 'Tempat Lahir', 55 | 'dob' => 'Tanggal Lahir', 56 | ]; 57 | -------------------------------------------------------------------------------- /resources/lang/id/auth.php: -------------------------------------------------------------------------------- 1 | 'Register', 6 | 'login' => 'Login', 7 | 'profile' => 'Profil Saya', 8 | 'welcome' => 'Selamat datang kembali :name.', 9 | 'failed' => 'Identitas tersebut tidak cocok dengan data kami.', 10 | 'throttle' => 'Terlalu banyak usaha masuk. Silahkan coba lagi dalam :seconds detik.', 11 | 'logout' => 'Keluar', 12 | 'logged_out' => 'Anda telah logout.', 13 | 'user_inactive' => 'User ini tidak aktif.', 14 | 'remember_me' => 'Ingat Saya', 15 | 16 | // Password 17 | 'change_password' => 'Ganti Password', 18 | 'password_changed' => 'Password berhasil diubah.', 19 | 'forgot_password' => 'Lupa Password?', 20 | 'reset_password' => 'Reset Password', 21 | 'send_reset_password_link' => 'Kirim Link Reset Password', 22 | 'old_password_failed' => 'Password lama tidak cocok!', 23 | 24 | // Attributes 25 | 'email' => 'Email', 26 | 'password' => 'Password', 27 | 'password_confirmation' => 'Ulangi Password', 28 | 'old_password' => 'Password Lama', 29 | 'new_password' => 'Password Baru', 30 | 'new_password_confirmation' => 'Ulangi Password Baru', 31 | 32 | // Authorizations 33 | 'role_unauthorized_access' => 'Anda tidak diizinkan mengakses halaman :path.', 34 | ]; 35 | -------------------------------------------------------------------------------- /resources/lang/id/group.php: -------------------------------------------------------------------------------- 1 | 'Grup', 6 | 'list' => 'Daftar Grup', 7 | 'search' => 'Cari Grup', 8 | 'detail' => 'Detail Grup', 9 | 'not_found' => 'Grup tidak ditemukan', 10 | 'empty' => 'Belum ada Grup', 11 | 'back_to_show' => 'Kembali ke detail Grup', 12 | 'back_to_index' => 'Kembali ke daftar Grup', 13 | 14 | // Actions 15 | 'create' => 'Buat Grup Baru', 16 | 'created' => 'Buat Grup baru telah berhasil.', 17 | 'show' => 'Lihat Detail Grup', 18 | 'edit' => 'Edit Grup', 19 | 'update' => 'Update Grup', 20 | 'updated' => 'Update data Grup telah berhasil.', 21 | 'delete' => 'Hapus Grup', 22 | 'delete_confirm' => 'Anda yakin akan menghapus Grup ini?', 23 | 'deleted' => 'Hapus data Grup telah berhasil.', 24 | 'undeleted' => 'Data Grup gagal dihapus.', 25 | 'undeleteable' => 'Data Grup tidak dapat dihapus.', 26 | 27 | // Attributes 28 | 'name' => 'Nama Grup', 29 | 'capacity' => 'Kapasitas', 30 | 'currency' => 'Mata Uang', 31 | 'payment_amount' => 'Iuran', 32 | 'description' => 'Deskripsi Grup', 33 | 'start_date' => 'Tanggal Mulai', 34 | 'end_date' => 'Tanggal Selesai', 35 | 'creator' => 'Dibuat oleh', 36 | 'winner_payoff' => 'Dapat Arisan', 37 | 38 | // Memberships 39 | 'members' => 'Anggota Grup', 40 | 'members_count' => 'Jumlah Anggota', 41 | 'empty_member' => 'Belum ada anggota grup.', 42 | 'add_member' => 'Tambah Anggota', 43 | 'add_member_text' => 'Tambah anggota: masukkan alamat email...', 44 | 'member_added' => ':name masuk menjadi anggota grup.', 45 | 'member_add_failed' => 'Grup sudah penuh, tidak dapat tambah member lagi.', 46 | 'remove_member' => 'Keluarkan', 47 | 'remove_member_confirm' => 'Anda yakin mengeluarkan :name dari grup ini?', 48 | 'member_removed' => ':name berhasil dikeluarkan dari grup.', 49 | 50 | // Statuses 51 | 'planned' => 'Planned', 52 | 'active' => 'Active', 53 | 'closed' => 'Closed', 54 | 55 | 'set_start_date' => 'Set Tanggal Mulai', 56 | 'set_start_date_confirm' => 'Anda yakin akan memulai grup ini?', 57 | 'started' => 'Group arisan dimulai.', 58 | 'set_end_date' => 'Set Tanggal Selesai', 59 | 'set_end_date_confirm' => 'Anda yakin akan menyatakan grup ini selesai?', 60 | 'ended' => 'Group arisan selesai.', 61 | 62 | // Relations 63 | 'meetings' => 'List Pertemuan', 64 | 'payments' => 'List Pembayaran', 65 | 'outstanding_payments' => 'Pembayaran Terlambat', 66 | ]; 67 | -------------------------------------------------------------------------------- /resources/lang/id/meeting.php: -------------------------------------------------------------------------------- 1 | 'Pertemuan', 6 | 'list' => 'List Pertemuan', 7 | 'detail' => 'Detail Pertemuan', 8 | 'back_to_index' => 'Kembali ke List Pertemuan', 9 | 'payment_total' => 'Dana Terkumpul', 10 | 'outstanding' => 'Kekurangan', 11 | 'win' => 'Menang', 12 | 13 | // Actions 14 | 'create' => 'Set Pertemuan ke :number', 15 | 'created' => 'Pertemuan ke :number di set tanggal :date, di :place.', 16 | 'show' => 'Lihat Detail Pertemuan', 17 | 'edit' => 'Edit Pertemuan ke :number', 18 | 'update' => 'Update Pertemuan ke :number', 19 | 'updated' => 'Pertemuan ke :number update tanggal :date, di :place.', 20 | 'delete' => 'Hapus Pertemuan', 21 | 'delete_confirm' => 'Anda yakin akan menghapus Pertemuan ini?', 22 | 'deleted' => 'Hapus Pertemuan telah berhasil.', 23 | 'undeleted' => 'Pertemuan gagal dihapus.', 24 | 'undeleteable' => 'Pertemuan tidak dapat dihapus.', 25 | 26 | 'set_winner' => 'Set Pemenang', 27 | 'winner_set' => 'Pemenang pertemuan ini adalah :name', 28 | 29 | // Attributes 30 | 'number' => 'Pertemuan ke', 31 | 'date' => 'Tanggal', 32 | 'place' => 'Tempat', 33 | 'winner' => 'Pemenang', 34 | 'notes' => 'Catatan Pertemuan', 35 | 'creator' => 'Dibuat oleh', 36 | 37 | // Relations 38 | 'payment' => 'Pembayaran', 39 | 'payments' => 'List Pembayaran', 40 | ]; 41 | -------------------------------------------------------------------------------- /resources/lang/id/nav_menu.php: -------------------------------------------------------------------------------- 1 | 'Dashboard', 5 | 'your_groups' => 'List Grup Anda', 6 | 'your_outstanding_payments' => 'Tunggakan Pembayaran Anda', 7 | ]; 8 | -------------------------------------------------------------------------------- /resources/lang/id/payment.php: -------------------------------------------------------------------------------- 1 | 'Pembayaran', 6 | 'list' => 'Daftar Pembayaran', 7 | 'search' => 'Cari Pembayaran', 8 | 'detail' => 'Detail Pembayaran', 9 | 'not_found' => 'Pembayaran tidak ditemukan', 10 | 'empty' => 'Belum ada Pembayaran', 11 | 'back_to_show' => 'Kembali ke detail Pembayaran', 12 | 'back_to_index' => 'Kembali ke daftar Pembayaran', 13 | 14 | // Actions 15 | 'pay' => 'Bayar', 16 | 'created' => 'Buat Pembayaran baru telah berhasil.', 17 | 'show' => 'Lihat Detail Pembayaran', 18 | 'edit' => 'Edit Pembayaran', 19 | 'update' => 'Update Pembayaran', 20 | 'updated' => 'Update data Pembayaran telah berhasil.', 21 | 'delete' => 'Hapus Pembayaran', 22 | 'delete_confirm' => 'Anda yakin akan menghapus Pembayaran ini?', 23 | 'deleted' => 'Hapus data Pembayaran telah berhasil.', 24 | 'undeleted' => 'Data Pembayaran gagal dihapus.', 25 | 'undeleteable' => 'Data Pembayaran tidak dapat dihapus.', 26 | 27 | // Attributes 28 | 'amount' => 'Jumlah', 29 | 'date' => 'Tanggal', 30 | 'to' => 'Dibayar Kepada', 31 | 'creator' => 'Dibuat oleh', 32 | 33 | // Status 34 | 'done' => 'Sudah', 35 | 'not_yet' => 'Belum', 36 | 'unpaid' => 'Belum Dibayar', 37 | ]; 38 | -------------------------------------------------------------------------------- /resources/lang/id/user.php: -------------------------------------------------------------------------------- 1 | 'User ID', 6 | 'user' => 'User', 7 | 'list' => 'Daftar User', 8 | 'profile' => 'Profil User', 9 | 'profile_edit' => 'Edit Profil Saya', 10 | 'profile_update' => 'Update Profil', 11 | 'profile_updated' => 'Update Profil anda berhasil.', 12 | 'empty' => 'Belum ada User', 13 | 'back_to_index' => 'Kembali ke Daftar User', 14 | 'search' => 'Cari User', 15 | 'not_found' => 'User tidak ditemukan.', 16 | 17 | // Actions 18 | 'show' => 'Lihat Detail', 19 | 'create' => 'Input User Baru', 20 | 'created' => 'Input User baru telah berhasil.', 21 | 'edit' => 'Edit User', 22 | 'update' => 'Update Data User', 23 | 'updated' => 'Update data User telah berhasil.', 24 | 'delete' => 'Hapus User', 25 | 'deleted' => 'Hapus data User telah berhasil.', 26 | 'undeleted' => 'Data User gagal dihapus.', 27 | 28 | // Attributes 29 | 'name' => 'Nama User', 30 | 'email' => 'Alamat Email', 31 | 'phone' => 'Telp/Hp.', 32 | 'is_active' => 'Status User', 33 | 'registered_at' => 'Terdaftar sejak', 34 | 35 | // Relations 36 | 'groups' => 'List Member', 37 | 'outstanding_payments' => 'Tunggakan Pembayaran', 38 | 'no_outstanding_payment' => 'Tidak ada tunggakan pembayaran.', 39 | 40 | // User status 41 | 'status' => 'Status', 42 | 'suspend' => 'Suspend User ini', 43 | 'suspend_confirm' => 'Anda yakin ingin meng-suspend user ini?', 44 | 'suspended' => 'User telah di-suspend.', 45 | 'activate' => 'Aktifkan User ini', 46 | 'activate_confirm' => 'Anda yakin akan mengaktifkan user ini?', 47 | 'activated' => 'User telah aktif kembali.', 48 | 49 | // Form Texts 50 | 'password_form_note' => 'Isi password hanya untuk mengganti password', 51 | 'default_password_note' => 'Password Default: :password', 52 | ]; 53 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title', __('auth.login')) 4 | 5 | @section('content') 6 |
7 |
8 |
9 |
10 |
Login
11 | 12 |
13 |
14 | {{ csrf_field() }} 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @if ($errors->has('email')) 23 | 24 | {{ $errors->first('email') }} 25 | 26 | @endif 27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 | 36 | @if ($errors->has('password')) 37 | 38 | {{ $errors->first('password') }} 39 | 40 | @endif 41 |
42 |
43 | 44 |
45 |
46 |
47 | 50 |
51 |
52 |
53 | 54 |
55 |
56 | 59 | 60 | 61 | {{ __('auth.forgot_password') }} 62 | 63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | @endsection 72 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/change.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title', __('auth.change_password')) 4 | 5 | @section('content') 6 |
7 |
8 |

{{ __('auth.change_password') }}

9 | {!! Form::open(['route' => 'password.change', 'method' => 'patch']) !!} 10 |
11 | {!! FormField::password('old_password', ['label'=> __('auth.old_password')]) !!} 12 | {!! FormField::password('password', ['label' => __('auth.new_password')]) !!} 13 | {!! FormField::password('password_confirmation', ['label' => __('auth.new_password_confirmation')]) !!} 14 |
15 | 19 | {!! Form::close() !!} 20 |
21 |
22 | @endsection 23 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title', __('auth.reset_password')) 4 | 5 | @section('content') 6 |
7 |
8 |
9 |
10 |
{{ __('auth.reset_password') }}
11 | 12 |
13 | @if (session('status')) 14 |
15 | {{ session('status') }} 16 |
17 | @endif 18 | 19 |
20 | {{ csrf_field() }} 21 | 22 |
23 | 24 | 25 |
26 | 27 | 28 | @if ($errors->has('email')) 29 | 30 | {{ $errors->first('email') }} 31 | 32 | @endif 33 |
34 |
35 | 36 |
37 |
38 | 41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | @endsection 50 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title', __('auth.reset_password')) 4 | 5 | @section('content') 6 |
7 |
8 |
9 |
10 |
{{ __('auth.reset_password') }}
11 | 12 |
13 |
14 | {{ csrf_field() }} 15 | 16 | 17 | 18 |
19 | 20 | 21 |
22 | 23 | 24 | @if ($errors->has('email')) 25 | 26 | {{ $errors->first('email') }} 27 | 28 | @endif 29 |
30 |
31 | 32 |
33 | 34 | 35 |
36 | 37 | 38 | @if ($errors->has('password')) 39 | 40 | {{ $errors->first('password') }} 41 | 42 | @endif 43 |
44 |
45 | 46 |
47 | 48 |
49 | 50 | 51 | @if ($errors->has('password_confirmation')) 52 | 53 | {{ $errors->first('password_confirmation') }} 54 | 55 | @endif 56 |
57 |
58 | 59 |
60 |
61 | 64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | @endsection 73 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title', __('auth.register')) 4 | 5 | @section('content') 6 |
7 |
8 |
9 |
10 |
{{ __('auth.register') }}
11 | 12 |
13 |
14 | {{ csrf_field() }} 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @if ($errors->has('name')) 23 | 24 | {{ $errors->first('name') }} 25 | 26 | @endif 27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 | 36 | @if ($errors->has('email')) 37 | 38 | {{ $errors->first('email') }} 39 | 40 | @endif 41 |
42 |
43 | 44 |
45 | 46 | 47 |
48 | 49 | 50 | @if ($errors->has('password')) 51 | 52 | {{ $errors->first('password') }} 53 | 54 | @endif 55 |
56 |
57 | 58 |
59 | 60 | 61 |
62 | 63 |
64 |
65 | 66 |
67 |
68 | 71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 | @endsection 80 | -------------------------------------------------------------------------------- /resources/views/groups/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title', __('group.create')) 4 | 5 | @section('content') 6 |
7 |
8 |
9 |

{{ __('group.create') }}

10 | {!! Form::open(['route' => 'groups.store']) !!} 11 |
12 | {!! FormField::text('name', ['required' => true, 'label' => __('group.name')]) !!} 13 |
14 |
15 | {!! FormField::text('capacity', [ 16 | 'min' => 0, 17 | 'type' => 'number', 18 | 'required' => true, 19 | 'label' => __('group.capacity'), 20 | ]) !!} 21 |
22 |
23 | {!! FormField::text('currency', [ 24 | 'required' => true, 25 | 'value' => old('currency', 'IDR'), 26 | 'label' => __('group.currency') 27 | ]) !!} 28 |
29 |
30 | {!! FormField::price('payment_amount', [ 31 | 'required' => true, 32 | 'label' => __('group.payment_amount') 33 | ]) !!} 34 |
35 |
36 | {!! FormField::textarea('description', ['label' => __('group.description')]) !!} 37 |
38 | 42 | {!! Form::close() !!} 43 |
44 |
45 |
46 | @endsection 47 | -------------------------------------------------------------------------------- /resources/views/groups/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title', __('group.edit')) 4 | 5 | @section('content') 6 | 7 |
8 |
9 | @if (request('action') == 'delete' && $group) 10 | @can('delete', $group) 11 |
12 |

{{ __('group.delete') }}

13 |
14 | 15 |

{{ $group->name }}

16 | 17 |

{{ $group->members()->count() }}

18 | 19 |

{{ $group->currency }}

20 | 21 |

{{ $group->status }}

22 | 23 |

{{ $group->description }}

24 | {!! $errors->first('group_id', ':message') !!} 25 |
26 |
27 |
{{ __('app.delete_confirm') }}
28 | 41 |
42 | @endcan 43 | @else 44 |
45 |

{{ __('group.edit') }}

46 | {!! Form::model($group, ['route' => ['groups.update', $group],'method' => 'patch']) !!} 47 |
48 | {!! FormField::text('name', ['required' => true, 'label' => __('group.name')]) !!} 49 |
50 |
51 | {!! FormField::text('capacity', [ 52 | 'min' => 0, 53 | 'type' => 'number', 54 | 'required' => true, 55 | 'label' => __('group.capacity'), 56 | ]) !!} 57 |
58 |
59 | {!! FormField::text('currency', ['required' => true, 'label' => __('group.currency')]) !!} 60 |
61 |
62 | {!! FormField::price('payment_amount', [ 63 | 'required' => true, 64 | 'label' => __('group.payment_amount') 65 | ]) !!} 66 |
67 |
68 |
69 |
{!! FormField::text('start_date', ['label' => __('group.start_date')]) !!}
70 |
{!! FormField::text('end_date', ['label' => __('group.end_date')]) !!}
71 |
72 | {!! FormField::textarea('description', ['label' => __('group.description')]) !!} 73 |
74 | 81 | {!! Form::close() !!} 82 |
83 |
84 |
85 | @endif 86 | @endsection 87 | 88 | @section('styles') 89 | {{ Html::style(url('css/plugins/jquery.datetimepicker.css')) }} 90 | @endsection 91 | 92 | @push('scripts') 93 | {{ Html::script(url('js/plugins/jquery.datetimepicker.js')) }} 94 | 104 | @endpush 105 | -------------------------------------------------------------------------------- /resources/views/groups/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title', trans('group.list')) 4 | 5 | @section('content') 6 |

7 |
8 | @can('create', new App\Group) 9 | {{ link_to_route('groups.create', trans('group.create'), [], ['class' => 'btn btn-success']) }} 10 | @endcan 11 |
12 | {{ trans('group.list') }} 13 | {{ trans('app.total') }} : {{ $groups->total() }} {{ trans('group.group') }} 14 |

15 |
16 |
17 |
18 |
19 | {{ Form::open(['method' => 'get','class' => 'form-inline']) }} 20 | {!! FormField::text('q', ['value' => request('q'), 'label' => trans('group.search'), 'class' => 'input-sm']) !!} 21 | {{ Form::submit(trans('group.search'), ['class' => 'btn btn-sm']) }} 22 | {{ link_to_route('groups.index', trans('app.reset')) }} 23 | {{ Form::close() }} 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | @foreach($groups as $key => $group) 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 56 | 57 | @endforeach 58 | 59 |
{{ trans('app.table_no') }}{{ trans('group.name') }}{{ trans('group.members') }}{{ trans('group.payment_amount') }}{{ trans('app.status') }}{{ trans('group.creator') }}{{ trans('app.action') }}
{{ $groups->firstItem() + $key }}{{ $group->nameLink() }}{{ $group->members_count }}{{ $group->currency }} {{ formatNo($group->payment_amount) }}{{ $group->status }}{{ $group->creator->name }} 47 | @can('view', $group) 48 | {!! link_to_route( 49 | 'groups.show', 50 | trans('app.show'), 51 | [$group], 52 | ['class' => 'btn btn-default btn-xs', 'id' => 'show-group-' . $group->id] 53 | ) !!} 54 | @endcan 55 |
60 |
{{ $groups->appends(Request::except('page'))->render() }}
61 |
62 |
63 |
64 | @endsection 65 | -------------------------------------------------------------------------------- /resources/views/groups/meetings.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.group') 2 | 3 | @section('subtitle', trans('group.meetings')) 4 | 5 | @section('content-group') 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | @for ($meetingNumber = 1; $meetingNumber <= $group->members()->count(); $meetingNumber++) 20 | @php 21 | $meeting = $meetings->where('number', $meetingNumber)->first(); 22 | @endphp 23 | @if ($meeting) 24 | 25 | 26 | 27 | 28 | 29 | 30 | 38 | 39 | @else 40 | 41 | 42 | 50 | 51 | 52 | @endif 53 | @endfor 54 | 55 |
{{ __('meeting.meeting') }}{{ __('meeting.date') }}{{ __('meeting.place') }}{{ __('meeting.winner') }}{{ __('meeting.payment') }}{{ __('app.action') }}
{{ $meetingNumber }}{{ $meeting->date }}{{ $meeting->place }}   31 | {{ link_to_route( 32 | 'meetings.show', 33 | __('app.show'), 34 | [$meeting], 35 | ['id' => 'show-meeting-'.$meetingNumber] 36 | ) }} 37 |
{{ $meetingNumber }} 43 | {{ link_to_route( 44 | 'groups.meetings.index', 45 | __('meeting.create', ['number' => $meetingNumber]), 46 | [$group, 'number' => $meetingNumber, 'action' => 'set-meeting'], 47 | ['id' => 'set-meeting-'.$meetingNumber] 48 | ) }} 49 |  
56 |
57 | 58 | @if (request('action') == 'set-meeting' && $acceptableNumber) 59 | @include('meetings.partials.set-meeting', ['meetingNumber' => $acceptableNumber]) 60 | @endif 61 | 62 | @endsection 63 | 64 | @section('styles') 65 | {{ Html::style(url('css/plugins/jquery.datetimepicker.css')) }} 66 | @endsection 67 | 68 | @push('scripts') 69 | {{ Html::script(url('js/plugins/jquery.datetimepicker.js')) }} 70 | 84 | @endpush 85 | -------------------------------------------------------------------------------- /resources/views/groups/members.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.group') 2 | 3 | @section('subtitle', __('group.members')) 4 | 5 | @section('content-group') 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | @forelse($group->members as $key => $member) 18 | @php 19 | $membershipId = $member->pivot->id; 20 | $winningMeeting = $meetings->where('winner_id', $membershipId)->first(); 21 | @endphp 22 | 23 | 24 | 25 | 26 | 41 | 42 | @empty 43 | 44 | @endforelse 45 | 46 |
{{ __('app.table_no') }}{{ __('user.name') }}{{ __('meeting.win') }}{{ __('app.action') }}
{{ 1 + $key }}{{ $member->name }}{{ $winningMeeting ? __('meeting.meeting').' '.$winningMeeting->number : '' }} 27 | @unless ($winningMeeting) 28 | {!! FormField::delete([ 29 | 'route' => ['groups.members.destroy', $group, $member], 30 | 'onsubmit' => __('group.remove_member_confirm', ['name' => $member->name]), 31 | 'class' => '', 32 | ], __('group.remove_member'), [ 33 | 'class' => 'btn btn-danger btn-xs', 34 | 'id' => 'remove-member-' . $member->pivot->id, 35 | 'title' => __('group.remove_member'), 36 | ], [ 37 | 'group_member_id' => $member->pivot->id 38 | ]) !!} 39 | @endunless 40 |
{{ __('group.empty_member') }}
47 | @if (!$group->isFull()) 48 |
49 | {{ Form::open(['route' => ['groups.members.store', $group]]) }} 50 |
51 | {{ Form::email('email', null, ['required' => true, 'class' => 'form-control', 'id' => 'email', 'placeholder' => __('group.add_member_text')]) }} 52 | 53 | {{ Form::submit(__('group.add_member'), ['class' => 'btn btn-info']) }} 54 | 55 |
56 | {{ Form::close() }} 57 |
58 | @endif 59 |
60 | @endsection 61 | -------------------------------------------------------------------------------- /resources/views/groups/outstanding-payments.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.group') 2 | 3 | @section('subtitle', trans('group.outstanding_payments')) 4 | 5 | @section('content-group') 6 | @foreach($meetings as $key => $meeting) 7 |
8 |
9 |

10 | 11 | {{ __('meeting.winner') }} : {{ optional($meeting->winner)->user->name }} 12 | 13 | {{ __('meeting.meeting') }} {{ $meeting->number }} 14 |

15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @php 27 | $no = 0; 28 | $outstandingPaymentAmount = 0; 29 | @endphp 30 | @foreach ($members as $key => $member) 31 | @php 32 | $membershipId = $member->pivot->id; 33 | $payment = $meeting->payments->filter(function ($payment) use ($membershipId, $meeting) { 34 | return $payment->membership_id == $membershipId 35 | && $payment->meeting_id == $meeting->id; 36 | })->first(); 37 | @endphp 38 | @unless ($payment) 39 | 40 | 41 | 42 | 45 | 48 | 49 | @php 50 | $outstandingPaymentAmount += $group->payment_amount; 51 | @endphp 52 | @endunless 53 | @endforeach 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
{{ __('app.table_no') }}{{ __('group.members') }}{{ __('payment.unpaid') }}{{ __('app.action') }}
{{ ++$no }}{{ $member->name }} 43 | {{ formatNo($group->payment_amount) }} 44 | 46 | {{ link_to_route('meetings.show', __('payment.pay'), $meeting, ['class' => 'btn btn-default btn-xs']) }} 47 |
{{ __('app.total') }} {{ __('payment.unpaid') }}{{ $group->currency }} {{ formatNo($outstandingPaymentAmount) }} 
63 |
64 | @endforeach 65 | @endsection 66 | -------------------------------------------------------------------------------- /resources/views/groups/partials/nav-tabs.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 16 |
17 | -------------------------------------------------------------------------------- /resources/views/groups/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.group') 2 | 3 | @section('subtitle', __('group.detail')) 4 | 5 | @section('action-buttons') 6 | @can('update', $group) 7 | {{ link_to_route('groups.edit', __('group.edit'), [$group], ['class' => 'btn btn-warning', 'id' => 'edit-group-'.$group->id]) }} 8 | @endcan 9 | @endsection 10 | 11 | @section('content-group') 12 | 30 | 31 | 38 | @if ($group->description) 39 |
40 | {{ trans('group.description') }}
{!! nl2br($group->description) !!} 41 |
42 | @endif 43 | 44 | @can('update', $group) 45 | @if ($group->isPlanned()) 46 | {{ Form::open([ 47 | 'route' => ['groups.set-start-date', $group], 48 | 'method' => 'patch', 49 | 'class' => 'form-inline', 50 | 'style' => 'display:inline', 51 | 'onsubmit' => 'return confirm("'.__('group.set_start_date_confirm').'")', 52 | ]) }} 53 | {!! FormField::text('start_date', ['required' => true, 'label' => false, 'placeholder' => __('group.start_date')]) !!} 54 | {{ Form::submit(__('group.set_start_date'), ['class' => 'btn btn-default', 'id' => 'set-start-date']) }} 55 | {{ Form::close() }} 56 | @endif 57 | 58 | @if ($group->isActive()) 59 | {{ Form::open([ 60 | 'route' => ['groups.set-end-date', $group], 61 | 'method' => 'patch', 62 | 'class' => 'form-inline', 63 | 'style' => 'display:inline', 64 | 'onsubmit' => 'return confirm("'.__('group.set_end_date_confirm').'")', 65 | ]) }} 66 | {!! FormField::text('end_date', ['required' => true, 'label' => false, 'placeholder' => __('group.end_date')]) !!} 67 | {{ Form::submit(__('group.set_end_date'), ['class' => 'btn btn-default', 'id' => 'set-end-date']) }} 68 | {{ Form::close() }} 69 | @endif 70 | @endcan 71 | 72 | @endsection 73 | 74 | @section('styles') 75 | {{ Html::style(url('css/plugins/jquery.datetimepicker.css')) }} 76 | @endsection 77 | 78 | @push('scripts') 79 | {{ Html::script(url('js/plugins/jquery.datetimepicker.js')) }} 80 | 90 | @endpush 91 | -------------------------------------------------------------------------------- /resources/views/groups/wip.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.group') 2 | 3 | @section('subtitle', trans('group.detail')) 4 | 5 | @section('content-group') 6 | Development in progress. 7 | @endsection 8 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title', 'Dashboard') 4 | 5 | @section('content') 6 |
7 |
8 |
9 |
10 |

{{ __('nav_menu.your_groups') }}

11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | @forelse($groups as $key => $group) 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | @empty 32 | 33 | @endforelse 34 | 35 |
{{ trans('app.table_no') }}{{ trans('group.name') }}{{ trans('group.members') }}{{ trans('group.payment_amount') }}{{ trans('app.status') }}
{{ 1 + $key }}{{ $group->nameLink() }}{{ $group->members_count }}{{ $group->currency }} {{ formatNo($group->payment_amount) }}{{ $group->status }}
{{ __('group.empty') }}
36 |
37 |
38 |
39 |
40 |
41 |

{{ __('nav_menu.your_outstanding_payments') }}

42 |
43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | @if ($outstandingPayments->isEmpty()) 55 | 56 | @endif 57 | @foreach($outstandingPayments->groupBy('group_id') as $groupId => $groupedMeetings) 58 | @php 59 | $no = 0; 60 | $outstandingPaymentsTotal = 0; 61 | @endphp 62 | 63 | @foreach($groupedMeetings as $key => $meeting) 64 | 65 | @php 66 | $payment = $meeting->payments->where('membership_id', $membershipIds[$meeting->group_id])->first(); 67 | @endphp 68 | 69 | @unless ($payment) 70 | 71 | 72 | 73 | 74 | 77 | 78 | 79 | @php $outstandingPaymentsTotal += $paymentAmount; @endphp 80 | @endif 81 | @endforeach 82 | 83 | 84 | 85 | 86 | 87 | 88 | @endforeach 89 | 90 |
{{ trans('app.table_no') }}{{ trans('group.name') }}{{ trans('meeting.number') }}{{ trans('payment.payment') }}{{ trans('app.status') }}
{{ __('user.no_outstanding_payment') }}
{{ ++$no }}{{ $meeting->group->nameLink() }}{{ link_to_route('meetings.show', $meeting->number, $meeting) }} 75 | {{ formatNo($paymentAmount = $meeting->group->payment_amount) }} 76 | {{ __('payment.not_yet') }}
{{ __('app.total') }}{{ formatNo($outstandingPaymentsTotal) }} 
91 |
92 |
93 |
94 | @endsection 95 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | @yield('title') - {{ config('app.name', 'Laravel') }} 12 | 13 | 14 | 15 | @yield('styles') 16 | 17 | 18 |
19 | @include('layouts.partials.top-nav') 20 | 21 |
@yield('content')
22 |
23 | 24 | 25 | 26 | @include('layouts.partials.noty') 27 | @stack('scripts') 28 | 29 | 30 | -------------------------------------------------------------------------------- /resources/views/layouts/group.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | @yield('subtitle', __('group.detail')) - {{ $group->name }} 5 | @endsection 6 | 7 | @section('content') 8 |

9 |
10 | @yield('action-buttons') 11 | {{ link_to_route('groups.index', __('group.back_to_index'), [], ['class' => 'btn btn-default']) }} 12 |
13 | {{ $group->name }} 14 |

15 | 16 |
17 |
18 | @include('groups.partials.nav-tabs') 19 | @yield('content-group') 20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
{{ __('group.name') }}{{ $group->name }}
{{ __('app.status') }}{{ $group->status }}
{{ __('group.capacity') }}{{ $group->capacity }}
{{ __('group.members') }}{{ $group->members->count() }}
{{ __('group.payment_amount') }}{{ $group->currency }} {{ formatNo($group->payment_amount) }}
{{ __('group.creator') }}{{ $group->creator->name }}
{{ __('group.description') }}{{ $group->description }}
37 |
38 |
39 |
40 | @endsection 41 | -------------------------------------------------------------------------------- /resources/views/layouts/partials/noty.blade.php: -------------------------------------------------------------------------------- 1 | @if(Session::has('flash_notification.message')) 2 | @php 3 | $level = Session::get('flash_notification.level'); 4 | if ($level == 'info') { 5 | $level = 'information'; 6 | } 7 | @endphp 8 | 9 | 17 | @endif 18 | -------------------------------------------------------------------------------- /resources/views/layouts/partials/top-nav.blade.php: -------------------------------------------------------------------------------- 1 | 61 | -------------------------------------------------------------------------------- /resources/views/meetings/partials/edit-meeting.blade.php: -------------------------------------------------------------------------------- 1 | 26 | -------------------------------------------------------------------------------- /resources/views/meetings/partials/set-meeting.blade.php: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /resources/views/meetings/partials/set-winner.blade.php: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /resources/views/meetings/partials/stats.blade.php: -------------------------------------------------------------------------------- 1 | 24 | 25 | 31 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ config('app.name') }} 9 | 10 | 11 | 12 | 13 | 14 | 66 | 67 | 68 |
69 | @if (Route::has('login')) 70 | 78 | @endif 79 | 80 |
81 |
82 | {{ config('app.name') }} 83 |
84 | 94 |

Develop by Nafies Luthfi with Laravel 5.5.

95 |
96 |
97 | 98 | 99 | -------------------------------------------------------------------------------- /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('welcome'); 17 | 18 | Auth::routes(); 19 | 20 | // Change Password Routes 21 | Route::get('change-password', 'Auth\ChangePasswordController@show')->name('password.change'); 22 | Route::patch('change-password', 'Auth\ChangePasswordController@update')->name('password.change'); 23 | 24 | Route::group(['middleware' => ['auth']], function () { 25 | /* 26 | * User Dashboard Route 27 | */ 28 | Route::get('/home', 'DashboardController@index')->name('home'); 29 | 30 | /* 31 | * Groups Routes 32 | */ 33 | Route::patch('groups/{group}/set-start-date', 'GroupsController@setStartDate')->name('groups.set-start-date'); 34 | Route::patch('groups/{group}/set-end-date', 'GroupsController@setEndDate')->name('groups.set-end-date'); 35 | Route::resource('groups', 'GroupsController'); 36 | Route::resource('groups.meetings', 'Groups\MeetingsController'); 37 | Route::resource('groups.payments', 'Groups\PaymentsController'); 38 | Route::resource('groups.members', 'Groups\MembersController'); 39 | 40 | /* 41 | * Meetings Routes 42 | */ 43 | Route::get('meetings/{meeting}', 'MeetingsController@show')->name('meetings.show'); 44 | Route::patch('meetings/{meeting}', 'MeetingsController@update')->name('meetings.update'); 45 | Route::post('meetings/{meeting}/payment-entry', 'MeetingsController@paymentEntry')->name('meetings.payment-entry'); 46 | Route::post('meetings/{meeting}/set-winner', 'MeetingsController@setWinner')->name('meetings.set-winner'); 47 | }); 48 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $uri = urldecode( 9 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 10 | ); 11 | 12 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 13 | // built-in PHP web server. This provides a convenient way to test a Laravel 14 | // application without having installed a "real" web server software here. 15 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 16 | return false; 17 | } 18 | 19 | require_once __DIR__.'/public/index.php'; 20 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/debugbar/.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 | !.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(); 20 | 21 | Hash::setRounds(4); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/Feature/Auth/ChangePasswordTest.php: -------------------------------------------------------------------------------- 1 | loginAsUser(); 16 | 17 | $this->visit(route('home')); 18 | $this->click(trans('auth.change_password')); 19 | 20 | $this->submitForm(trans('auth.change_password'), [ 21 | 'old_password' => 'secret', 22 | 'password' => 'rahasia', 23 | 'password_confirmation' => 'rahasia', 24 | ]); 25 | 26 | $this->see(trans('auth.password_changed')); 27 | 28 | $this->assertTrue( 29 | app('hash')->check('rahasia', $user->password), 30 | 'The password should changed!' 31 | ); 32 | } 33 | 34 | /** @test */ 35 | public function user_cannot_change_password_if_old_password_wrong() 36 | { 37 | $user = $this->loginAsUser(); 38 | 39 | $this->visit(route('home')); 40 | $this->click(trans('auth.change_password')); 41 | 42 | $this->submitForm(trans('auth.change_password'), [ 43 | 'old_password' => 'member1', 44 | 'password' => 'rahasia', 45 | 'password_confirmation' => 'rahasia', 46 | ]); 47 | 48 | $this->see(trans('auth.old_password_failed')); 49 | 50 | $this->assertTrue( 51 | app('hash')->check('secret', $user->password), 52 | 'The password shouldn\'t changed!' 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /tests/Feature/Auth/LoginTest.php: -------------------------------------------------------------------------------- 1 | create(['name' => 'Nama Member', 'email' => 'email@mail.com']); 17 | 18 | $this->visit(route('login')); 19 | 20 | $this->submitForm(trans('auth.login'), [ 21 | 'email' => 'email@mail.com', 22 | 'password' => 'secret', 23 | ]); 24 | 25 | $this->see(trans('auth.welcome', ['name' => $user->name])); 26 | $this->seePageIs(route('home')); 27 | $this->seeIsAuthenticated(); 28 | 29 | $this->press(trans('auth.logout')); 30 | 31 | $this->seePageIs(route('welcome')); 32 | } 33 | 34 | /** @test */ 35 | public function member_invalid_login() 36 | { 37 | $this->visit(route('login')); 38 | 39 | $this->submitForm(trans('auth.login'), [ 40 | 'email' => 'email@mail.com', 41 | 'password' => 'member', 42 | ]); 43 | 44 | $this->seePageIs(route('login')); 45 | $this->dontSeeIsAuthenticated(); 46 | } 47 | 48 | /** @test */ 49 | public function user_cannot_login_if_they_are_in_inactive_status() 50 | { 51 | $user = factory(User::class)->create([ 52 | 'email' => 'email@mail.com', 53 | 'is_active' => 0, 54 | ]); 55 | 56 | $this->visit(route('login')); 57 | 58 | $this->submitForm(trans('auth.login'), [ 59 | 'email' => 'email@mail.com', 60 | 'password' => 'secret', 61 | ]); 62 | 63 | $this->see(trans('auth.user_inactive')); 64 | $this->seePageIs(route('login')); 65 | $this->dontSeeIsAuthenticated(); 66 | } 67 | 68 | /** @test */ 69 | public function unauthenticated_users_are_redirects_to_login_page() 70 | { 71 | $this->visit(route('home')); 72 | $this->seePageIs(route('login')); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /tests/Feature/Auth/RegistrationTest.php: -------------------------------------------------------------------------------- 1 | visit(route('register')); 16 | 17 | $this->submitForm(trans('auth.register'), [ 18 | 'name' => 'Nama Member', 19 | 'email' => 'email@mail.com', 20 | 'password' => 'password.111', 21 | 'password_confirmation' => 'password.111', 22 | ]); 23 | 24 | $this->seePageIs(route('home')); 25 | 26 | $this->seeInDatabase('users', [ 27 | 'name' => 'Nama Member', 28 | 'email' => 'email@mail.com', 29 | ]); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/Feature/Auth/ResetPasswordTest.php: -------------------------------------------------------------------------------- 1 | create(['email' => 'testing@app.dev']); 20 | 21 | $this->notSeeInDatabase('password_resets', [ 22 | 'email' => 'testing@app.dev', 23 | ]); 24 | 25 | // Reset Request 26 | $this->visit(route('password.request')); 27 | $this->see(trans('auth.reset_password')); 28 | $this->type('testing@app.dev', 'email'); 29 | $this->press(trans('auth.send_reset_password_link')); 30 | 31 | $this->seePageIs('password/reset'); 32 | $this->see(trans('passwords.sent')); 33 | $this->seeInDatabase('password_resets', [ 34 | 'email' => 'testing@app.dev', 35 | ]); 36 | 37 | Notification::assertSentTo( 38 | $user, 39 | 'Illuminate\Auth\Notifications\ResetPassword', 40 | function ($notification, $channels) use ($user) { 41 | $userPasswordReset = \DB::table('password_resets') 42 | ->where('email', $user->email)->first(); 43 | 44 | return password_verify($notification->token, $userPasswordReset->token); 45 | } 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tests/Feature/Groups/GroupDateEntryTest.php: -------------------------------------------------------------------------------- 1 | loginAsUser(); 17 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 18 | 19 | $this->visit(route('groups.show', $group)); 20 | $this->see(__('group.planned')); 21 | 22 | $this->submitForm(__('group.set_start_date'), [ 23 | 'start_date' => '2017-01-01', 24 | ]); 25 | 26 | $this->seePageIs(route('groups.show', $group)); 27 | $this->see(__('group.started')); 28 | $this->see(__('group.active')); 29 | 30 | $this->seeInDatabase('groups', [ 31 | 'id' => $group->id, 32 | 'start_date' => '2017-01-01', 33 | ]); 34 | } 35 | 36 | /** @test */ 37 | public function user_can_set_group_as_closed_by_set_end_date() 38 | { 39 | $user = $this->loginAsUser(); 40 | $group = factory(Group::class)->create([ 41 | 'start_date' => '2017-01-01', 42 | 'creator_id' => $user->id, 43 | ]); 44 | 45 | $this->visit(route('groups.show', $group)); 46 | $this->see(__('group.active')); 47 | 48 | $this->submitForm(__('group.set_end_date'), [ 49 | 'end_date' => '2017-12-31', 50 | ]); 51 | 52 | $this->seePageIs(route('groups.show', $group)); 53 | $this->see(__('group.ended')); 54 | $this->see(__('group.closed')); 55 | 56 | $this->seeInDatabase('groups', [ 57 | 'id' => $group->id, 58 | 'end_date' => '2017-12-31', 59 | ]); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /tests/Feature/Groups/GroupMemberEntryTest.php: -------------------------------------------------------------------------------- 1 | loginAsUser(); 18 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 19 | $newMember = $this->createUser(); 20 | 21 | $this->visit(route('groups.members.index', $group)); 22 | $this->submitForm(__('group.add_member'), [ 23 | 'email' => $newMember->email, 24 | ]); 25 | 26 | $this->seePageIs(route('groups.members.index', $group)); 27 | $this->see(__('group.member_added', ['name' => $newMember->name])); 28 | $this->see($newMember->name); 29 | 30 | $this->seeInDatabase('group_members', [ 31 | 'group_id' => $group->id, 32 | 'user_id' => $newMember->id, 33 | ]); 34 | } 35 | 36 | /** @test */ 37 | public function user_can_remove_member_from_a_group() 38 | { 39 | $user = $this->loginAsUser(); 40 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 41 | $newMember = $this->createUser(); 42 | 43 | $group->addMember($newMember); 44 | 45 | $groupMember = \DB::table('group_members')->where([ 46 | 'group_id' => $group->id, 47 | 'user_id' => $newMember->id, 48 | ])->first(); 49 | 50 | $this->visit(route('groups.members.index', $group)); 51 | $this->press('remove-member-'.$groupMember->id); 52 | 53 | $this->seePageIs(route('groups.members.index', $group)); 54 | $this->see(__('group.member_removed', ['name' => $newMember->name])); 55 | 56 | $this->dontSeeInDatabase('group_members', [ 57 | 'id' => $groupMember->id, 58 | 'group_id' => $group->id, 59 | 'user_id' => $newMember->id, 60 | ]); 61 | } 62 | 63 | /** @test */ 64 | public function user_can_entry_non_exsits_user_to_the_group() 65 | { 66 | $user = $this->loginAsUser(); 67 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 68 | 69 | $this->visit(route('groups.members.index', $group)); 70 | $this->submitForm(__('group.add_member'), [ 71 | 'email' => 'nonexistsmember@mail.com', 72 | ]); 73 | 74 | $this->seePageIs(route('groups.members.index', $group)); 75 | $this->see(__('group.member_added', ['name' => 'nonexistsmember'])); 76 | 77 | $this->seeInDatabase('users', [ 78 | 'email' => 'nonexistsmember@mail.com', 79 | ]); 80 | 81 | $newMember = User::where('email', 'nonexistsmember@mail.com')->first(); 82 | 83 | $this->seeInDatabase('group_members', [ 84 | 'group_id' => $group->id, 85 | 'user_id' => $newMember->id, 86 | ]); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /tests/Feature/Groups/MeetingEntryTest.php: -------------------------------------------------------------------------------- 1 | loginAsUser(); 18 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 19 | $newMember = $this->createUser(); 20 | $group->addMember($newMember); 21 | 22 | $meetingNumber = 1; 23 | $this->visit(route('groups.meetings.index', $group)); 24 | $this->seeElement('a', ['id' => 'set-meeting-'.$meetingNumber]); 25 | $this->click('set-meeting-'.$meetingNumber); 26 | $this->seePageIs(route('groups.meetings.index', [$group, 'action' => 'set-meeting', 'number' => $meetingNumber])); 27 | 28 | $this->submitForm(__('meeting.create', ['number' => $meetingNumber]), [ 29 | 'number' => $meetingNumber, 30 | 'date' => '2017-01-06', 31 | 'place' => 'Inter Cafe', 32 | 'notes' => 'Si A belum transfer.', 33 | ]); 34 | 35 | $this->seePageIs(route('groups.meetings.index', $group)); 36 | $this->see(__('meeting.created', [ 37 | 'number' => $meetingNumber, 38 | 'date' => '2017-01-06', 39 | 'place' => 'Inter Cafe', 40 | ])); 41 | 42 | $this->seeInDatabase('meetings', [ 43 | 'group_id' => $group->id, 44 | 'number' => $meetingNumber, 45 | 'date' => '2017-01-06', 46 | 'place' => 'Inter Cafe', 47 | 'notes' => 'Si A belum transfer.', 48 | ]); 49 | } 50 | 51 | /** @test */ 52 | public function user_can_edit_existing_meeting() 53 | { 54 | $user = $this->loginAsUser(); 55 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 56 | $newMember = $this->createUser(); 57 | $group->addMember($newMember); 58 | $meeting = factory(Meeting::class)->create(['group_id' => $group->id]); 59 | 60 | $meetingNumber = 1; 61 | $this->visit(route('meetings.show', $meeting)); 62 | $this->seeElement('a', ['id' => 'edit-meeting-'.$meetingNumber]); 63 | $this->click('edit-meeting-'.$meetingNumber); 64 | $this->seePageIs(route('meetings.show', [$meeting, 'action' => 'edit-meeting'])); 65 | 66 | $this->submitForm(__('meeting.update', ['number' => $meetingNumber]), [ 67 | 'date' => '2017-02-06', 68 | 'place' => 'Inter Cafe 1', 69 | 'notes' => 'Si B belum transfer.', 70 | ]); 71 | 72 | $this->seePageIs(route('meetings.show', $meeting)); 73 | $this->see(__('meeting.updated', [ 74 | 'number' => $meetingNumber, 75 | 'date' => '2017-02-06', 76 | 'place' => 'Inter Cafe 1', 77 | ])); 78 | 79 | $this->seeInDatabase('meetings', [ 80 | 'group_id' => $group->id, 81 | 'number' => $meetingNumber, 82 | 'date' => '2017-02-06', 83 | 'place' => 'Inter Cafe 1', 84 | 'notes' => 'Si B belum transfer.', 85 | ]); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /tests/Feature/ManageGroupsTest.php: -------------------------------------------------------------------------------- 1 | create(); 17 | 18 | $user = $this->loginAsUser(); 19 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 20 | 21 | $this->visit(route('groups.index')); 22 | $this->dontSee($otherGroup->name); 23 | $this->see($group->name); 24 | } 25 | 26 | private function getCreateFields(array $overrides = []) 27 | { 28 | return array_merge([ 29 | 'name' => 'Group 1 name', 30 | 'capacity' => 20, 31 | 'currency' => 'IDR', 32 | 'payment_amount' => 100000, 33 | 'description' => 'Group 1 description', 34 | ], $overrides); 35 | } 36 | 37 | /** @test */ 38 | public function user_can_create_a_group() 39 | { 40 | $this->loginAsUser(); 41 | $this->visit(route('groups.index')); 42 | 43 | $this->click(trans('group.create')); 44 | $this->seePageIs(route('groups.create')); 45 | 46 | $this->submitForm(trans('group.create'), $this->getCreateFields()); 47 | 48 | $this->seePageIs(route('groups.show', Group::first())); 49 | 50 | $this->seeInDatabase('groups', $this->getCreateFields()); 51 | } 52 | 53 | /** @test */ 54 | public function create_group_action_must_pass_validations() 55 | { 56 | $this->loginAsUser(); 57 | 58 | // Name empty 59 | $this->post(route('groups.store'), $this->getCreateFields(['name' => ''])); 60 | $this->assertSessionHasErrors('name'); 61 | 62 | // Name 70 characters 63 | $this->post(route('groups.store'), $this->getCreateFields([ 64 | 'name' => str_repeat('Test Title', 7), 65 | ])); 66 | $this->assertSessionHasErrors('name'); 67 | 68 | // Description 256 characters 69 | $this->post(route('groups.store'), $this->getCreateFields([ 70 | 'description' => str_repeat('Long description', 16), 71 | ])); 72 | $this->assertSessionHasErrors('description'); 73 | } 74 | 75 | private function getEditFields(array $overrides = []) 76 | { 77 | return array_merge([ 78 | 'name' => 'Group 1 name', 79 | 'capacity' => 24, 80 | 'currency' => 'IDR', 81 | 'payment_amount' => 100000, 82 | 'start_date' => '2017-01-01', 83 | 'end_date' => '2017-12-31', 84 | 'description' => 'Group 1 description', 85 | ], $overrides); 86 | } 87 | 88 | /** @test */ 89 | public function user_can_edit_a_group() 90 | { 91 | $user = $this->loginAsUser(); 92 | $group = factory(Group::class)->create(['name' => 'Testing 123', 'creator_id' => $user->id]); 93 | 94 | $this->visit(route('groups.show', $group)); 95 | $this->click('edit-group-'.$group->id); 96 | $this->seePageIs(route('groups.edit', $group)); 97 | 98 | $this->submitForm(trans('group.update'), $this->getEditFields()); 99 | 100 | $this->seePageIs(route('groups.show', $group)); 101 | 102 | $this->seeInDatabase('groups', [ 103 | 'id' => $group->id, 104 | ] + $this->getEditFields()); 105 | } 106 | 107 | /** @test */ 108 | public function edit_group_action_must_pass_validations() 109 | { 110 | $user = $this->loginAsUser(); 111 | $group = factory(Group::class)->create(['name' => 'Testing 123', 'creator_id' => $user->id]); 112 | 113 | // Name empty 114 | $this->patch(route('groups.update', $group), $this->getEditFields(['name' => ''])); 115 | $this->assertSessionHasErrors('name'); 116 | 117 | // Name 70 characters 118 | $this->patch(route('groups.update', $group), $this->getEditFields([ 119 | 'name' => str_repeat('Test Title', 7), 120 | ])); 121 | $this->assertSessionHasErrors('name'); 122 | 123 | // Description 256 characters 124 | $this->patch(route('groups.update', $group), $this->getEditFields([ 125 | 'description' => str_repeat('Long description', 16), 126 | ])); 127 | $this->assertSessionHasErrors('description'); 128 | } 129 | 130 | /** @test */ 131 | public function user_can_delete_a_group() 132 | { 133 | $user = $this->loginAsUser(); 134 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 135 | 136 | $this->visit(route('groups.edit', $group)); 137 | $this->click('del-group-'.$group->id); 138 | $this->seePageIs(route('groups.edit', [$group, 'action' => 'delete'])); 139 | 140 | $this->press(trans('app.delete_confirm_button')); 141 | 142 | $this->dontSeeInDatabase('groups', [ 143 | 'id' => $group->id, 144 | ]); 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /tests/Feature/Meetings/MeetingWinnerTest.php: -------------------------------------------------------------------------------- 1 | loginAsUser(); 18 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 19 | $newMember = $this->createUser(); 20 | $group->addMember($newMember); 21 | $meeting = factory(Meeting::class)->create([ 22 | 'group_id' => $group->id, 23 | ]); 24 | 25 | $membershipId = $group->members->first()->pivot->id; 26 | $this->visit(route('meetings.show', $meeting)); 27 | $this->seeElement('a', ['id' => 'set-winner']); 28 | $this->click('set-winner'); 29 | $this->seePageIs(route('meetings.show', [$meeting, 'action' => 'set-winner'])); 30 | 31 | $this->submitForm(__('meeting.set_winner'), [ 32 | 'winner_id' => $membershipId, 33 | ]); 34 | 35 | $this->seePageIs(route('meetings.show', $meeting)); 36 | $this->see(__('meeting.winner_set', ['name' => $newMember->name])); 37 | 38 | $this->seeInDatabase('meetings', [ 39 | 'id' => $meeting->id, 40 | 'winner_id' => $membershipId, 41 | ]); 42 | } 43 | 44 | /** @test */ 45 | public function user_can_only_select_winner_from_winner_candidates_who_has_not_win() 46 | { 47 | $user = $this->loginAsUser(); 48 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 49 | 50 | $oldWinner = $this->createUser(); 51 | $winnerCandidate = $this->createUser(); 52 | $group->addMember($oldWinner); 53 | $group->addMember($winnerCandidate); 54 | 55 | $winnerMembershipId = $group->members->first()->pivot->id; 56 | $winnerCandidateMembershipId = $group->members->last()->pivot->id; 57 | 58 | $firstMeeting = factory(Meeting::class)->create([ 59 | 'number' => 1, 60 | 'group_id' => $group->id, 61 | 'winner_id' => $winnerMembershipId, 62 | ]); 63 | 64 | $secondMeeting = factory(Meeting::class)->create([ 65 | 'number' => 2, 66 | 'group_id' => $group->id, 67 | ]); 68 | 69 | $this->visit(route('meetings.show', $secondMeeting)); 70 | $this->click('set-winner'); 71 | $this->seePageIs(route('meetings.show', [$secondMeeting, 'action' => 'set-winner'])); 72 | $this->dontSee(''); 73 | $this->see(''); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /tests/Feature/Meetings/PaymentEntryTest.php: -------------------------------------------------------------------------------- 1 | loginAsUser(); 18 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 19 | $newMember = $this->createUser(); 20 | $group->addMember($newMember); 21 | $meetingNumber = 1; 22 | $meeting = factory(Meeting::class)->create([ 23 | 'number' => $meetingNumber, 24 | 'group_id' => $group->id, 25 | ]); 26 | 27 | $membershipId = $group->members->first()->pivot->id; 28 | $this->visit(route('meetings.show', $meeting)); 29 | $this->seeElement('input', ['id' => 'payment-entry-'.$membershipId]); 30 | 31 | $this->submitForm('payment-entry-'.$membershipId, [ 32 | 'membership_id' => $membershipId, 33 | 'amount' => 123, 34 | 'date' => date('Y-m-d'), 35 | 'payment_receiver_id' => $newMember->id, 36 | ]); 37 | 38 | $this->seePageIs(route('meetings.show', $meeting)); 39 | $this->see(__('payment.updated')); 40 | 41 | $this->seeInDatabase('payments', [ 42 | 'membership_id' => $membershipId, 43 | 'meeting_id' => $meeting->id, 44 | 'payment_receiver_id' => $newMember->id, 45 | 'amount' => 123, 46 | 'date' => date('Y-m-d'), 47 | 'creator_id' => $user->id, 48 | ]); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | createUser($userDataOverrides); 17 | $this->actingAs($user); 18 | 19 | return $user; 20 | } 21 | 22 | protected function createUser($userDataOverrides = []) 23 | { 24 | return factory(User::class)->create($userDataOverrides); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/Unit/Models/MeetingTest.php: -------------------------------------------------------------------------------- 1 | make(); 22 | 23 | $this->assertInstanceOf(User::class, $meeting->creator); 24 | $this->assertEquals($meeting->creator_id, $meeting->creator->id); 25 | } 26 | 27 | /** @test */ 28 | public function a_meeting_has_many_payments_relation() 29 | { 30 | $meeting = factory(Meeting::class)->create(); 31 | $payment = factory(Payment::class)->create(['meeting_id' => $meeting->id]); 32 | 33 | $this->assertInstanceOf(Collection::class, $meeting->payments); 34 | $this->assertInstanceOf(Payment::class, $meeting->payments->first()); 35 | } 36 | 37 | /** @test */ 38 | public function a_meeting_has_belongs_to_group_relation() 39 | { 40 | $group = factory(Group::class)->create(); 41 | $meeting = factory(Meeting::class)->create(['group_id' => $group->id]); 42 | 43 | $this->assertInstanceOf(Group::class, $meeting->group); 44 | $this->assertEquals($meeting->group_id, $meeting->group->id); 45 | } 46 | 47 | /** @test */ 48 | public function a_meeting_has_belongs_to_winner_relation() 49 | { 50 | $group = factory(Group::class)->create(); 51 | $newMember = $this->createUser(); 52 | $group->addMember($newMember); 53 | $membershipId = $group->members->first()->pivot->id; 54 | $meeting = factory(Meeting::class)->create([ 55 | 'group_id' => $group->id, 56 | 'winner_id' => $membershipId, 57 | ]); 58 | 59 | $this->assertInstanceOf(Membership::class, $meeting->winner); 60 | $this->assertEquals($membershipId, $meeting->winner->id); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /tests/Unit/Models/MembershipTest.php: -------------------------------------------------------------------------------- 1 | create(); 19 | $newMember = $this->createUser(); 20 | $group->addMember($newMember); 21 | 22 | $membership = Membership::first(); 23 | 24 | $this->assertInstanceOf(User::class, $membership->user); 25 | $this->assertEquals($newMember->id, $membership->user->id); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tests/Unit/Models/UserTest.php: -------------------------------------------------------------------------------- 1 | create(); 19 | $group = factory(Group::class)->create(); 20 | 21 | $user->groups()->attach($group->id); 22 | 23 | $this->seeInDatabase('group_members', [ 24 | 'user_id' => $user->id, 25 | 'group_id' => $group->id, 26 | ]); 27 | 28 | $this->assertInstanceOf(Collection::class, $user->groups); 29 | $this->assertInstanceOf(Group::class, $user->groups->first()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/Unit/Policies/GroupPolicyTest.php: -------------------------------------------------------------------------------- 1 | createUser(); 17 | $this->assertTrue($user->can('create', new Group)); 18 | } 19 | 20 | /** @test */ 21 | public function user_cannot_view_other_group_detail() 22 | { 23 | $user = $this->createUser(); 24 | $group = factory(Group::class)->create(); 25 | 26 | $this->assertFalse($user->can('view', $group)); 27 | } 28 | 29 | /** @test */ 30 | public function group_creator_can_view_group_detail() 31 | { 32 | $user = $this->createUser(); 33 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 34 | 35 | $this->assertTrue($user->can('view', $group)); 36 | } 37 | 38 | /** @test */ 39 | public function group_member_can_view_group_detail() 40 | { 41 | $member = $this->createUser(); 42 | $group = factory(Group::class)->create(); 43 | 44 | $group->members()->attach($member->id); 45 | 46 | $this->assertTrue($member->can('view', $group)); 47 | } 48 | 49 | /** @test */ 50 | public function only_group_creator_that_can_update_group() 51 | { 52 | $user = $this->createUser(); 53 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 54 | 55 | $this->assertTrue($user->can('update', $group)); 56 | 57 | $user = $this->createUser(); 58 | $this->assertFalse($user->can('update', $group)); 59 | } 60 | 61 | /** @test */ 62 | public function only_group_creator_that_can_delete_group() 63 | { 64 | $user = $this->createUser(); 65 | $group = factory(Group::class)->create(['creator_id' => $user->id]); 66 | 67 | $this->assertTrue($user->can('delete', $group)); 68 | 69 | $user = $this->createUser(); 70 | $this->assertFalse($user->can('delete', $group)); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | let mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/assets/js/app.js', 'public/js') 15 | .options({ 16 | processCssUrls: false 17 | }) 18 | .sass('resources/assets/sass/app.scss', 'public/css'); 19 | --------------------------------------------------------------------------------