forked from engsahaly/API-COURSE
-
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.
- Loading branch information
0 parents
commit c288554
Showing
215 changed files
with
22,245 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 | ||
|
||
[docker-compose.yml] | ||
indent_size = 4 |
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,58 @@ | ||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
|
||
LOG_CHANNEL=stack | ||
LOG_DEPRECATIONS_CHANNEL=null | ||
LOG_LEVEL=debug | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=companies | ||
DB_USERNAME=root | ||
DB_PASSWORD= | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
FILESYSTEM_DISK=local | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
|
||
MEMCACHED_HOST=127.0.0.1 | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=mailhog | ||
MAIL_PORT=1025 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS="[email protected]" | ||
MAIL_FROM_NAME="${APP_NAME}" | ||
|
||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_BUCKET= | ||
AWS_USE_PATH_STYLE_ENDPOINT=false | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_HOST= | ||
PUSHER_PORT=443 | ||
PUSHER_SCHEME=https | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
VITE_PUSHER_HOST="${PUSHER_HOST}" | ||
VITE_PUSHER_PORT="${PUSHER_PORT}" | ||
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" | ||
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
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,11 @@ | ||
* text=auto | ||
|
||
*.blade.php diff=html | ||
*.css diff=css | ||
*.html diff=html | ||
*.md diff=markdown | ||
*.php diff=php | ||
|
||
/.github export-ignore | ||
CHANGELOG.md export-ignore | ||
.styleci.yml export-ignore |
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,20 @@ | ||
/node_modules | ||
/public/build | ||
/public/hot | ||
/public/storage | ||
/public/media | ||
/storage/*.key | ||
/vendor | ||
/stubs | ||
.env | ||
.env.backup | ||
.env.production | ||
.phpunit.result.cache | ||
Homestead.json | ||
Homestead.yaml | ||
auth.json | ||
npm-debug.log | ||
yarn-error.log | ||
/.fleet | ||
/.idea | ||
/.vscode |
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,5 @@ | ||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
RewriteCond %{REQUEST_URI} !^/public/ | ||
RewriteRule ^(.*)$ /public/$1 [L,QSA] | ||
</IfModule> |
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,54 @@ | ||
## API COURSE (Project Files) | ||
|
||
**Created By :** Mahmoud Anwar | ||
**Email :** [email protected] | ||
**Phone :** +2-01000166099 | ||
|
||
This is the main readme file for the Project files used in the API Course on Udemy | ||
|
||
## Installation | ||
|
||
To get started, clone this repository. | ||
|
||
``` | ||
git clone https://github.com/engsahaly/API-COURSE.git | ||
``` | ||
|
||
Next, copy your `.env.example` file as `.env` and configure your Database connection. | ||
|
||
``` | ||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=YOUR-DATABASE-NAME | ||
DB_USERNAME=YOUR-DATABASE-USERNAME | ||
DB_PASSWORD=YOUR-DATABASE-PASSWROD | ||
``` | ||
|
||
## Run Packages and helpers | ||
|
||
You have to all used packages and load helpers as below. | ||
|
||
``` | ||
composer install | ||
npm install | ||
npm run dev | ||
npm run build | ||
``` | ||
|
||
## Generate new application key | ||
|
||
You have to generate new application key as below. | ||
|
||
``` | ||
php artisan key:generate | ||
``` | ||
|
||
## Run Migrations and Seeders | ||
|
||
You have to run all the migration files included with the project and also run seeders as below. | ||
|
||
``` | ||
php artisan migrate | ||
php artisan db:seed | ||
``` |
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 | ||
|
||
namespace App\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* Define the application's command schedule. | ||
* | ||
* @param \Illuminate\Console\Scheduling\Schedule $schedule | ||
* @return void | ||
*/ | ||
protected function schedule(Schedule $schedule) | ||
{ | ||
// $schedule->command('inspire')->hourly(); | ||
} | ||
|
||
/** | ||
* Register the commands for the application. | ||
* | ||
* @return void | ||
*/ | ||
protected function commands() | ||
{ | ||
$this->load(__DIR__.'/Commands'); | ||
|
||
require base_path('routes/console.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,40 @@ | ||
<?php | ||
|
||
namespace App\Enums; | ||
|
||
enum AdStatus: int | ||
{ | ||
case REVIEW = 1; | ||
case APPROVED = 2; | ||
case CANCELLED = 3; | ||
|
||
public function color(): string | ||
{ | ||
return match($this) | ||
{ | ||
self::REVIEW => 'bg-warning', | ||
self::APPROVED => 'bg-success', | ||
self::CANCELLED => 'bg-danger', | ||
}; | ||
} | ||
|
||
public function icon(): string | ||
{ | ||
return match($this) | ||
{ | ||
self::REVIEW => 'fe fe-check', | ||
self::APPROVED => 'fe fe-check-square', | ||
self::CANCELLED => 'fe fe-x', | ||
}; | ||
} | ||
|
||
public function lang(): string | ||
{ | ||
return match($this) | ||
{ | ||
self::REVIEW => __('lang.review'), | ||
self::APPROVED => __('lang.approved'), | ||
self::CANCELLED => __('lang.cancelled'), | ||
}; | ||
} | ||
} |
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,36 @@ | ||
<?php | ||
|
||
namespace App\Enums; | ||
|
||
enum DomainStatuses: int | ||
{ | ||
case ACTIVE = 1; | ||
case INACTIVE = 0; | ||
|
||
public function color(): string | ||
{ | ||
return match($this) | ||
{ | ||
self::ACTIVE => 'bg-success', | ||
self::INACTIVE => 'bg-danger', | ||
}; | ||
} | ||
|
||
public function icon(): string | ||
{ | ||
return match($this) | ||
{ | ||
self::ACTIVE => 'fe fe-check fe-16', | ||
self::INACTIVE => 'fe fe-x fe-16', | ||
}; | ||
} | ||
|
||
public function lang(): string | ||
{ | ||
return match($this) | ||
{ | ||
self::ACTIVE => __('lang.active'), | ||
self::INACTIVE => __('lang.inactive'), | ||
}; | ||
} | ||
} |
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,36 @@ | ||
<?php | ||
|
||
namespace App\Enums; | ||
|
||
enum MessageStatuses: int | ||
{ | ||
case SEEN = 1; | ||
case UNSEEN = 0; | ||
|
||
public function color(): string | ||
{ | ||
return match($this) | ||
{ | ||
self::SEEN => 'bg-success', | ||
self::UNSEEN => 'bg-danger', | ||
}; | ||
} | ||
|
||
public function icon(): string | ||
{ | ||
return match($this) | ||
{ | ||
self::SEEN => 'fe fe-eye fe-13', | ||
self::UNSEEN => 'fe fe-eye-off fe-13', | ||
}; | ||
} | ||
|
||
public function lang(): string | ||
{ | ||
return match($this) | ||
{ | ||
self::SEEN => __('lang.seen'), | ||
self::UNSEEN => __('lang.unseen'), | ||
}; | ||
} | ||
} |
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,50 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||
use Throwable; | ||
|
||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* A list of exception types with their corresponding custom log levels. | ||
* | ||
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*> | ||
*/ | ||
protected $levels = [ | ||
// | ||
]; | ||
|
||
/** | ||
* A list of the exception types that are not reported. | ||
* | ||
* @var array<int, class-string<\Throwable>> | ||
*/ | ||
protected $dontReport = [ | ||
// | ||
]; | ||
|
||
/** | ||
* A list of the inputs that are never flashed to the session on validation exceptions. | ||
* | ||
* @var array<int, string> | ||
*/ | ||
protected $dontFlash = [ | ||
'current_password', | ||
'password', | ||
'password_confirmation', | ||
]; | ||
|
||
/** | ||
* Register the exception handling callbacks for the application. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->reportable(function (Throwable $e) { | ||
// | ||
}); | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
namespace App\Helpers; | ||
|
||
class ApiResponse | ||
{ | ||
static function sendResponse($code = 200, $msg = null, $data = null) | ||
{ | ||
$response = [ | ||
'status' => $code, | ||
'msg' => $msg, | ||
'data' => $data, | ||
]; | ||
|
||
return response()->json($response, $code); | ||
} | ||
} |
Oops, something went wrong.