-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Search system, sharing system, context menu added. All ideas implemen…
…ted and project finished. Maybe bugfixes will come.
- Loading branch information
1 parent
f993ef3
commit be4e7f3
Showing
34 changed files
with
346 additions
and
550 deletions.
There are no files selected for viewing
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
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
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,65 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Document; | ||
|
||
use Livewire\Component; | ||
|
||
class Share extends Component | ||
{ | ||
public $document; | ||
public $users; | ||
public $email; | ||
public $attachUser; | ||
public $message; | ||
|
||
protected $listeners = ['newUserAdded', 'flashMessage']; | ||
|
||
public function newUserAdded() | ||
{ | ||
$this->users = $this->document->user()->get(); | ||
} | ||
|
||
public function share() | ||
{ | ||
$attachUser = \App\Models\User::where('email', $this->email)->first(); | ||
|
||
if ($attachUser == null) { | ||
$this->flashMessage("Bu kullanıcı sistemde bulunmadığından kendisini yetkilendiremezsiniz."); | ||
return; | ||
} else { | ||
$this->flashMessage("Başarıyla paylaşım eklendi."); | ||
} | ||
$this->document->user()->attach($attachUser); | ||
$this->newUserAdded(); | ||
} | ||
|
||
public function deleteShare($uid) | ||
{ | ||
$deletedUser = \App\Models\User::where('id', $uid)->first(); | ||
$this->document->user()->detach($deletedUser); | ||
$this->flashMessage("Kullanıcı paylaşımı kaldırıldı."); | ||
$this->newUserAdded(); | ||
} | ||
|
||
public function redirectToDocument() | ||
{ | ||
return redirect()->to(route('showDocument', $this->document->id)); | ||
} | ||
|
||
public function flashMessage($message) | ||
{ | ||
$this->message = $message; | ||
} | ||
|
||
public function mount() | ||
{ | ||
$this->document = \App\Models\Document::where('id', request()->documentId)->first(); | ||
$this->users = $this->document->user()->get(); | ||
$this->message = ""; | ||
} | ||
|
||
public function render() | ||
{ | ||
return view('livewire.document.share'); | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.