-
Notifications
You must be signed in to change notification settings - Fork 7
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 52e7ee1
Showing
569 changed files
with
155,007 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,15 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 |
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 @@ | ||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
|
||
LOG_CHANNEL=stack | ||
|
||
YOUR_TIME_ZONE=Africa/Cairo | ||
|
||
NOTIFY_THEME=dark | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=laravel | ||
DB_USERNAME=root | ||
DB_PASSWORD= | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_DRIVER=smtp | ||
MAIL_HOST=smtp.mailtrap.io | ||
MAIL_PORT=2525 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS=null | ||
MAIL_FROM_NAME="${APP_NAME}" | ||
|
||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_BUCKET= | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
MIX_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,5 @@ | ||
* text=auto | ||
*.css linguist-vendored | ||
*.scss linguist-vendored | ||
*.js linguist-vendored | ||
CHANGELOG.md 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,12 @@ | ||
/node_modules | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
.env | ||
.env.backup | ||
.phpunit.result.cache | ||
Homestead.json | ||
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log |
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: | ||
preset: laravel | ||
disabled: | ||
- unused_use | ||
finder: | ||
not-name: | ||
- index.php | ||
- server.php | ||
js: | ||
finder: | ||
not-name: | ||
- webpack.mix.js | ||
css: true |
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,140 @@ | ||
# BlogerDay | ||
> Use Laravel v6.18.37 | ||
## Description | ||
![Build](https://img.shields.io/appveyor/build/HeshamAdel007/BlogerDay?color=44cc11&style=flat-square) | ||
![Version](https://img.shields.io/docker/v/HeshamAdel007/BlogerDay?color=44cc11&sort=date&style=flat-square) | ||
![Downloads](https://img.shields.io/github/downloads/HeshamAdel007/BlogerDay/total?color=44cc11&style=flat-square) | ||
![License](https://img.shields.io/github/license/HeshamAdel007/BlogerDay?color=44cc11&style=flat-square) | ||
|
||
#### BlogerDay - Web Projects Build By Laravel Framework | ||
|
||
|
||
## Images | ||
- You Can Show More Image In Folder [info_images] | ||
<div> | ||
<img src ="https://github.com/HeshamAdel007/BlogerDay/blob/master/info_images/img-3.png" width = "350px" height="200px"> | ||
<img src ="https://github.com/HeshamAdel007/BlogerDay/blob/master/info_images/img-5.png" width = "350px" height="200px" align="right"> | ||
<img src ="https://github.com/HeshamAdel007/BlogerDay/blob/master/info_images/img-6.png" width = "350px" height="200px"> | ||
<img src ="https://github.com/HeshamAdel007/BlogerDay/blob/master/info_images/img-4.png" width = "350px" height="200px" align="right"> | ||
</div> | ||
|
||
<br> | ||
|
||
|
||
## Installation | ||
|
||
### 1. Downloade Project | ||
Run this at the command line: | ||
```bash | ||
git clone git@github.com:HeshamAdel007/BlogerDay.git | ||
``` | ||
### 2. Install Laravel | ||
```bash | ||
Composer install | ||
``` | ||
- Create a New .env File | ||
- Could Copy From Existing .env.example, Update Relevant Settings (DB_DATABASE, DB_USERNAME,.....) | ||
|
||
- Generate App Encryption Key | ||
```bash | ||
php artisan key:generate | ||
``` | ||
- Migrate The DataBase | ||
- You Can Use My Data You Will Find In WinRAR File[ database(blogerday) ] | ||
- Open PhpMyAdmin And Make Import To File [ blogerdays.sql ] Will Add Some Data To Tray Project | ||
- Or Can Make Tour Data | ||
```bash | ||
php artisan migrate | ||
``` | ||
|
||
- Migrate The Sedder | ||
```bash | ||
php artisan db:seed | ||
``` | ||
|
||
- Use Laratrust For Handle [Roles & Permissions] Inside Application, | ||
You Can Edit This [Roles & Permissions] | ||
```php | ||
// Will Find This Roles & Permissions In [ config/laratrust_seeder.php ] | ||
'owner' => [ | ||
'users' => 'c,r,u,d', | ||
'post' => 'c,r,u,d', | ||
'category' => 'c,r,u,d', | ||
'tag' => 'c,r,u,d', | ||
'gallery' => 'c,r,u,d', | ||
'setting' => 'r,u', | ||
'profile' => 'r,u', | ||
'contact' => 'r,d', | ||
], | ||
'super_admin' => [ | ||
], | ||
'admin' => [ | ||
], | ||
'user' => [ | ||
], | ||
``` | ||
|
||
## 3. Functions | ||
- When Register New User OR Login By Socialite Will Add Role & Create Profile [ User ] For This User | ||
```php | ||
// Will Find This Function In User Model [ app/User.php ] | ||
// Delete Comment After Make Databases Seeders | ||
protected static function boot() { | ||
parent::boot(); | ||
static::created( function ($user) { | ||
$user->profile()->create([ | ||
'user_id' => $user->id, | ||
]); | ||
$user->attachRole('user'); | ||
$user->attachPermissions(['read_profile', 'update_profile', 'read_setting']); | ||
}); | ||
} // End Of Boot | ||
``` | ||
|
||
## 4. Routes | ||
- In This Project I Make 2 Routes | ||
- 1 Particular BackEnd [ DashBoard ] And You Will Find This In Path [routes/backend/web.php] | ||
- 2 Particular ForntEnd [ Users ] And You Will Find This In Path [routes/web.php] | ||
- You Will Find This Routes Configuration In Path [app/Providers/RouteServiceProvider] If You Need Make Any Changes On Route | ||
- I Make No One Can’t Register If You Need Stopped This Change From False To True | ||
```php | ||
// Change This From False To True | ||
Auth::routes(['register' => false, 'verify' => true]); | ||
``` | ||
|
||
## 5. View Composer | ||
- I Use View Composer To Path Some Data To Speciflc Views Pages | ||
- And Will Find This In Path [app/Providers/AppServiceProvider] | ||
```php | ||
// Example About View Composer | ||
View::composer([ | ||
'layouts.front-end.parts-sidebar.most-views', | ||
'pages.front-end.home', | ||
'pages.front-end.category-page', | ||
'layouts.front-end.search' | ||
], function ($view) { | ||
$view->with('post_trend', Post::with('category:id,name,slug', 'photo:id,image')->where([ | ||
['status', '=', 'published'], | ||
['deleted_at', '=', Null], | ||
])->withCount('comments') | ||
->orderByDesc('view_count') | ||
->get()); | ||
}); | ||
``` | ||
|
||
|
||
## 6. Package & Tools Used | ||
|
||
- **[AdminLTE ](https://adminlte.io/)** [ v3.0.5 ] | ||
|
||
- **[Laratrust ](https://laratrust.santigarcor.me/docs/5.2/)** [ v5.2.9 ] | ||
|
||
- **[Laravel Notify ](https://github.com/mckenziearts/laravel-notify)** [ v1.1.2 ] | ||
|
||
- **[Intervention Image ](http://image.intervention.io/)** [ v2.5.1 ] | ||
|
||
|
||
## 7. License | ||
|
||
The Project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). |
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,43 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Category extends Model | ||
{ | ||
protected $table = 'categories'; | ||
|
||
protected $guarded = []; | ||
|
||
public function children() | ||
{ | ||
return $this->hasMany('App\Category', 'parent_id'); | ||
|
||
} // End OF children | ||
|
||
public function childrenRecursive() | ||
{ | ||
return $this->children()->with('childrenRecursive'); | ||
|
||
} // End OF childrenRecursive | ||
|
||
// With & Where Use In Front End Page[ Home ] | ||
public function post() { | ||
return $this->belongsToMany(Post::class); | ||
|
||
} // End Of Posts | ||
|
||
public function postWithImage() { | ||
return $this->belongsToMany(Post::class) | ||
->withCount('comments') | ||
->with('photo:id,image') | ||
->where([ | ||
['status', '=', 'published'], | ||
['deleted_at', '=', Null], | ||
]); | ||
|
||
} // End Of Get Post With Image | ||
|
||
|
||
} // End Of Model |
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,31 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Comment extends Model | ||
{ | ||
protected $table = 'comments'; | ||
|
||
protected $guarded = []; | ||
|
||
public function user() | ||
{ | ||
return $this->belongsTo(User::class); | ||
|
||
} // End Of User | ||
|
||
public function post() | ||
{ | ||
return $this->hasOne(Post::class); | ||
|
||
} // End Of Post | ||
|
||
public function replies() | ||
{ | ||
return $this->hasMany(Comment::class, 'parent_id'); | ||
|
||
} // End Of Replies | ||
|
||
} // End Of Model |
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,42 @@ | ||
<?php | ||
|
||
namespace App\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* The Artisan commands provided by your application. | ||
* | ||
* @var array | ||
*/ | ||
protected $commands = [ | ||
// | ||
]; | ||
|
||
/** | ||
* 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,13 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Contact extends Model | ||
{ | ||
protected $table = 'contacts'; | ||
|
||
protected $guarded = []; | ||
|
||
} // End Of Model |
Oops, something went wrong.