This repository was archived by the owner on Feb 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added public group search and listing
- Loading branch information
Richard Dern
committed
Nov 22, 2020
1 parent
fa115bb
commit e507f4d
Showing
27 changed files
with
431 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,9 @@ public function rules() | |
'invite_only' => [ | ||
'boolean', | ||
], | ||
'auto_accept_users' => [ | ||
'boolean', | ||
], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,9 @@ public function rules() | |
'invite_only' => [ | ||
'boolean', | ||
], | ||
'auto_accept_users' => [ | ||
'boolean', | ||
], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
namespace App\Notifications; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Notifications\Messages\MailMessage; | ||
use Illuminate\Notifications\Notification; | ||
use Illuminate\Support\Facades\URL; | ||
use App\Models\User; | ||
use App\Models\Group; | ||
|
||
class AsksToJoinGroup extends Notification implements ShouldQueue | ||
{ | ||
use Queueable; | ||
|
||
/** | ||
* Inviting user | ||
* | ||
* @var \App\Models\User | ||
*/ | ||
protected $user; | ||
|
||
/** | ||
* Group to invite a user in | ||
* | ||
* @var \App\Models\Group | ||
*/ | ||
protected $group; | ||
|
||
/** | ||
* Create a new notification instance. | ||
* | ||
* @param \App\Models\User $user User asking to join group | ||
* @param \App\Models\Group $group | ||
* @return void | ||
*/ | ||
public function __construct(User $user, Group $group) | ||
{ | ||
$this->user = $user; | ||
$this->group = $group; | ||
} | ||
|
||
/** | ||
* Get the notification's delivery channels. | ||
* | ||
* @param mixed $notifiable | ||
* @return array | ||
*/ | ||
public function via($notifiable) | ||
{ | ||
return ['mail']; | ||
} | ||
|
||
/** | ||
* Get the mail representation of the notification. | ||
* | ||
* @param mixed $notifiable | ||
* @return \Illuminate\Notifications\Messages\MailMessage | ||
*/ | ||
public function toMail($notifiable) | ||
{ | ||
return (new MailMessage) | ||
->from(env('MAIL_FROM_ADDRESS')) | ||
->line(sprintf('Hello there ! %s wants to join a group you created in Cyca: %s.', $this->user->name, $this->group->name)) | ||
->action(sprintf('Accept %s in %s', $this->user->name, $this->group->name), URL::signedRoute('group.signed_approve_user', ['user' => $this->user->id, 'group' => $this->group->id])) | ||
->line('You can safely ignore this email if you prefer to decline.') | ||
->line('Thank you for using our application!'); | ||
} | ||
|
||
/** | ||
* Get the array representation of the notification. | ||
* | ||
* @param mixed $notifiable | ||
* @return array | ||
*/ | ||
public function toArray($notifiable) | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
database/migrations/2020_11_20_093843_add_auto_accept_users_to_groups_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class AddAutoAcceptUsersToGroupsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('groups', function (Blueprint $table) { | ||
$table->boolean('auto_accept_users')->default(false)->after('invite_only'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('groups', function (Blueprint $table) { | ||
$table->dropColumn(['auto_accept_users']); | ||
}); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"/js/app.js": "/js/app.js?id=1d555fd70203cffc9c80", | ||
"/themes/cyca-dark/theme.css": "/themes/cyca-dark/theme.css?id=e29a17c9206c1115cdc5", | ||
"/themes/cyca-light/theme.css": "/themes/cyca-light/theme.css?id=8477ce9a3672bfafbcf7", | ||
"/js/groups.js": "/js/groups.js?id=b2ec2701fad753638af7", | ||
"/js/highlights.js": "/js/highlights.js?id=16f38cce999df6250471", | ||
"/js/history.js": "/js/history.js?id=8087cec05785ced6f72b", | ||
"/js/import.js": "/js/import.js?id=71b164490001afbe4d7c", | ||
"/js/themes-browser.js": "/js/themes-browser.js?id=55ba7c074c4c4e52bc19", | ||
"/js/app.js": "/js/app.js?id=78811c630a18dc4c3b90", | ||
"/themes/cyca-dark/theme.css": "/themes/cyca-dark/theme.css?id=afb6085e0137be5723c3", | ||
"/themes/cyca-light/theme.css": "/themes/cyca-light/theme.css?id=be5a16cf0e6f85afa3b1", | ||
"/js/groups.js": "/js/groups.js?id=f8ceca1188bafecc6853", | ||
"/js/highlights.js": "/js/highlights.js?id=e22cbaca83e2f10cef32", | ||
"/js/history.js": "/js/history.js?id=04f1837a5d38b6c7385f", | ||
"/js/import.js": "/js/import.js?id=dc4db8077d2231b2ff27", | ||
"/js/themes-browser.js": "/js/themes-browser.js?id=9590890f2ae0200cf94c", | ||
"/themes/cyca-dark/theme.json": "/themes/cyca-dark/theme.json?id=e6af9f523b70bc467aa4", | ||
"/themes/cyca-light/theme.json": "/themes/cyca-light/theme.json?id=bb59033be8f29999311e" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.