-
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.
Dashboard basic ui tamamlandı. Modeller eklendi
- Loading branch information
1 parent
bb2b404
commit 28c0a34
Showing
23 changed files
with
397 additions
and
40 deletions.
There are no files selected for viewing
Submodule client
deleted from
df3021
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,13 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Document; | ||
|
||
use Livewire\Component; | ||
|
||
class Edit extends Component | ||
{ | ||
public function render() | ||
{ | ||
return view('livewire.document.edit'); | ||
} | ||
} |
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,41 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Folder; | ||
|
||
use Livewire\Component; | ||
use App\Models\Folder; | ||
|
||
class Create extends Component | ||
{ | ||
public $isCreatingFolder = false; | ||
public $name = ""; | ||
public $message = ""; | ||
|
||
public function confirmCreatingFolder() | ||
{ | ||
$this->isCreatingFolder = true; | ||
} | ||
|
||
public function createNewFolder() | ||
{ | ||
try { | ||
$folder = Folder::create([ | ||
'name' => $this->name | ||
]); | ||
|
||
$folder->user()->attach(auth()->user()); | ||
} catch (\Throwable $e) { | ||
$this->emitTo('dashboard', 'flashMessage', "Oluşturma işlemi başarısız oldu!"); | ||
} | ||
$this->emitTo('dashboard', 'flashMessage', $this->name . " isimli klasör başarıyla eklendi!"); | ||
|
||
$this->emitTo('folder.show', 'newFolderCreated'); | ||
$this->isCreatingFolder = false; | ||
$this->name = ""; | ||
} | ||
|
||
public function render() | ||
{ | ||
return view('livewire.folder.create'); | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Folder; | ||
|
||
use Livewire\Component; | ||
|
||
class ListContents extends Component | ||
{ | ||
public function render() | ||
{ | ||
return view('livewire.folder.list-contents'); | ||
} | ||
} |
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,27 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Folder; | ||
|
||
use Livewire\Component; | ||
|
||
class Show extends Component | ||
{ | ||
public $folders; | ||
|
||
protected $listeners = ['newFolderCreated']; | ||
|
||
public function newFolderCreated() | ||
{ | ||
$this->folders = auth()->user()->folder()->orderBy('updated_at', 'DESC')->get(); | ||
} | ||
|
||
public function mount() | ||
{ | ||
$this->folders = auth()->user()->folder()->orderBy('updated_at', 'DESC')->get(); | ||
} | ||
|
||
public function render() | ||
{ | ||
return view('livewire.folder.show'); | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Folder extends Model | ||
{ | ||
use HasFactory; | ||
|
||
protected $fillable = ['name']; | ||
|
||
public function user() | ||
{ | ||
return $this->belongsToMany(User::class); | ||
} | ||
|
||
public function document() | ||
{ | ||
return $this->hasMany(Document::class); | ||
} | ||
} |
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
34 changes: 34 additions & 0 deletions
34
server/database/migrations/2020_11_08_162644_create_folders_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,34 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class CreateFoldersTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('folders', function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('name'); | ||
$table->foreignId('parent_folder_id')->nullable(); | ||
$table->foreign('parent_folder_id')->references('id')->on('folders')->cascadeOnDelete(); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('folders'); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
server/database/migrations/2020_11_08_214254_create_folder_user_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,34 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class CreateFolderUserTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('folder_user', function (Blueprint $table) { | ||
$table->id(); | ||
$table->foreignId('folder_id'); | ||
$table->foreignId('user_id'); | ||
$table->foreign('folder_id')->on('folders')->references('id')->cascadeOnDelete(); | ||
$table->foreign('user_id')->on('users')->references('id')->cascadeOnDelete(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('folder_user'); | ||
} | ||
} |
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
File renamed without changes.
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,24 @@ | ||
<?php | ||
|
||
namespace Database\Seeders; | ||
|
||
use Illuminate\Database\Seeder; | ||
use Illuminate\Support\Facades\Hash; | ||
use App\Models\User; | ||
|
||
class UserSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
* | ||
* @return void | ||
*/ | ||
public function run() | ||
{ | ||
User::create([ | ||
'name' => 'Doğukan Öksüz', | ||
'email' => '[email protected]', | ||
'password' => Hash::make('divergent') | ||
]); | ||
} | ||
} |
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,35 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="csrf-token" content="{{ csrf_token() }}"> | ||
|
||
<title>{{ config('app.name', 'Laravel') }}</title> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="csrf-token" content="{{ csrf_token() }}"> | ||
|
||
<!-- Google Font --> | ||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet"> | ||
<title>{{ config('app.name', 'Laravel') }}</title> | ||
|
||
<!-- Styles --> | ||
<link rel="stylesheet" href="{{ asset('css/app.css') }}"> | ||
<!-- Google Font --> | ||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet"> | ||
|
||
@livewireStyles | ||
<!-- Styles --> | ||
<link rel="stylesheet" href="{{ asset('css/app.css') }}"> | ||
|
||
<!-- Scripts --> | ||
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.js" defer></script> | ||
</head> | ||
<body class="font-sans antialiased"> | ||
<div class="min-h-screen bg-gray-100"> | ||
@livewire('navigation-dropdown') | ||
@livewireStyles | ||
|
||
<!-- Page Content --> | ||
<main> | ||
{{ $slot }} | ||
</main> | ||
</div> | ||
<!-- Scripts --> | ||
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.js" defer></script> | ||
</head> | ||
|
||
@stack('modals') | ||
<body class="font-sans antialiased"> | ||
<div class="min-h-screen bg-gray-100"> | ||
@livewire('navigation-dropdown') | ||
|
||
<!-- Page Content --> | ||
<main> | ||
{{ $slot }} | ||
</main> | ||
</div> | ||
|
||
@stack('modals') | ||
|
||
@livewireScripts | ||
</body> | ||
|
||
@livewireScripts | ||
</body> | ||
</html> |
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,3 @@ | ||
<div> | ||
{{-- Stop trying to control. --}} | ||
</div> |
Oops, something went wrong.