-
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.
Merge branch 'dev' of https://github.com/DanericNetwork/Biblio-App in…
…to feature/dashboard-main-pagina # Conflicts: # src/resources/vue/components/icon.vue # src/resources/vue/components/terminal-scan.vue # src/resources/vue/pages/index.vue # src/routes/web.php
- Loading branch information
Showing
41 changed files
with
1,916 additions
and
648 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,8 @@ | ||
<?php | ||
|
||
namespace App\Enums\Imports; | ||
|
||
enum ImportSources: string | ||
{ | ||
case OPEN_LIBRARY = 'openlibrary'; | ||
} |
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,55 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Enums\ModifiedEnum; | ||
use App\Models\Item; | ||
use Inertia\Inertia; | ||
|
||
class AdminController extends Controller | ||
{ | ||
public function index() | ||
{ | ||
return Inertia::render('admin/index', [ | ||
'userData' => [ | ||
'name' => 'John Doe', | ||
], | ||
'count' => [ | ||
'items' => 10, | ||
'customers' => 20, | ||
'reservations' => 30, | ||
'invoices' => 40, | ||
], | ||
'chart1' => [ | ||
'labels' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug'], | ||
'series' => [1, 2, 3, 4, 5, 6, 7, 8] | ||
], | ||
'chart2' => [ | ||
'labels' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug'], | ||
'series' => [0, 1, 2, 3, 4, 5, 6, 7] | ||
], | ||
]); | ||
} | ||
|
||
public function items() { | ||
|
||
$items = Item::where('modified_kind', '!=', ModifiedEnum::deleted)->paginate(10)->through(function ($item) { | ||
return [ | ||
'id' => $item->id, | ||
'name' => $item->name, | ||
'description' => $item->description, | ||
'author' => $item->author->name, | ||
'category' => $item->category->category, | ||
'age_rating' => $item->ageRating->rating, | ||
'ISBN' => $item->ISBN, | ||
'modified_kind' => $item->modified_kind, | ||
'modified_user' => $item->modified_user, | ||
'modified_at' => $item->modified_at, | ||
]; | ||
}); | ||
|
||
return Inertia::render('admin/items/index', [ | ||
'items' => $items, | ||
]); | ||
} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
class AuthorController extends Controller | ||
{ | ||
// | ||
} |
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,86 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
use App\Enums\ResponseStatus; | ||
use App\Http\Requests\SearchUsersRequest; | ||
use App\Models\User; | ||
use App\Traits\CommonTrait; | ||
use Inertia\Inertia; | ||
|
||
class UserController extends Controller | ||
{ | ||
use CommonTrait; | ||
|
||
/** | ||
* Display a listing of the resource. | ||
*/ | ||
public function index() | ||
{ | ||
// render page | ||
} | ||
|
||
/** | ||
* Show the form for creating a new resource. | ||
*/ | ||
public function create() | ||
{ | ||
// render page | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
*/ | ||
public function store(Request $request) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
*/ | ||
public function show(User $user) | ||
{ | ||
// render page | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
*/ | ||
public function update() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
*/ | ||
public function destroy() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Search users | ||
*/ | ||
public function search(SearchUsersRequest $request) { | ||
$validated = $request->validated(); | ||
$search = $validated['search']; | ||
|
||
$users = User::where('last_name', 'like', "%{$search}%") | ||
->orWhere('first_name', 'like', "%{$search}%") | ||
->orWhere('email', 'like', "%{$search}%") | ||
->orWhere('id', 'like', "%{$search}%") | ||
->orWhereHas('libraryPasses', function($query) use ($search) { | ||
$query->where('barcode', 'like', "%{$search}%"); | ||
}) | ||
->get(); | ||
|
||
return $this->CommonResponse( | ||
ResponseStatus::success, | ||
'Search results', | ||
$users | ||
); | ||
} | ||
} |
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,30 @@ | ||
<?php | ||
|
||
namespace App\Http\Requests; | ||
|
||
use App\Models\Item; | ||
use Illuminate\Foundation\Http\FormRequest; | ||
|
||
class SearchItemRequest extends FormRequest | ||
{ | ||
/** | ||
* Determine if the user is authorized to make this request. | ||
*/ | ||
public function authorize(): bool | ||
{ | ||
$user = auth()->user(); | ||
return $user->can('search', Item::class); | ||
} | ||
|
||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> | ||
*/ | ||
public function rules(): array | ||
{ | ||
return [ | ||
'search' => 'required|string|max:255' | ||
]; | ||
} | ||
} |
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,30 @@ | ||
<?php | ||
|
||
namespace App\Http\Requests; | ||
|
||
use App\Models\Reservation; | ||
use Illuminate\Foundation\Http\FormRequest; | ||
|
||
class SearchReservationRequest extends FormRequest | ||
{ | ||
/** | ||
* Determine if the user is authorized to make this request. | ||
*/ | ||
public function authorize(): bool | ||
{ | ||
$user = auth()->user(); | ||
return $user->can('search', Reservation::class); | ||
} | ||
|
||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> | ||
*/ | ||
public function rules(): array | ||
{ | ||
return [ | ||
'search' => 'required|string|min:3|max:255', | ||
]; | ||
} | ||
} |
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,30 @@ | ||
<?php | ||
|
||
namespace App\Http\Requests; | ||
|
||
use App\Models\User; | ||
use Illuminate\Foundation\Http\FormRequest; | ||
|
||
class SearchUsersRequest extends FormRequest | ||
{ | ||
/** | ||
* Determine if the user is authorized to make this request. | ||
*/ | ||
public function authorize(): bool | ||
{ | ||
$user = auth()->user(); | ||
return $user->can('search', User::class); | ||
} | ||
|
||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> | ||
*/ | ||
public function rules(): array | ||
{ | ||
return [ | ||
'search' => 'required|string|max:255' | ||
]; | ||
} | ||
} |
Oops, something went wrong.