This repository has been archived by the owner on Apr 7, 2020. It is now read-only.
-
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 pull request #22 from salis77/develop
merging changes in develop branch for about 2 month!
- Loading branch information
Showing
97 changed files
with
8,315 additions
and
1,202 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,52 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Article extends Model | ||
{ | ||
public $created_atp; | ||
protected $fillable=[ | ||
'article_category_id', | ||
'order', | ||
'title', | ||
'body', | ||
'seo_title', | ||
'img', | ||
'slug', | ||
'seo_desc', | ||
'img_thumbnail', | ||
'category_id', | ||
'user_id', | ||
'product_id', | ||
]; | ||
public function article_category() | ||
{ | ||
return $this->belongsTo('App\ArticleCategory'); | ||
} | ||
|
||
public function keywords() | ||
{ | ||
return $this->belongsToMany('App\Keyword','article_keyword'); | ||
} | ||
public function getRouteKeyName() | ||
{ | ||
return 'slug'; | ||
} | ||
|
||
public function user() | ||
{ | ||
return $this->belongsTo('App\User'); | ||
} | ||
|
||
public function getPersianDateAttribute() | ||
{ | ||
|
||
$v=new \Verta($this->created_at); | ||
return $v->format('%B %d، %Y'); | ||
|
||
} | ||
|
||
|
||
} |
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 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class ArticleCategory extends Model | ||
{ | ||
protected $table = "article_categories"; | ||
protected $fillable=['name','slug','img','desc']; | ||
public function articles() | ||
{ | ||
return $this->hasMany('App\Article'); | ||
} | ||
} |
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,42 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use App\User; | ||
use Illuminate\Broadcasting\Channel; | ||
use Illuminate\Queue\SerializesModels; | ||
use Illuminate\Broadcasting\PrivateChannel; | ||
use Illuminate\Broadcasting\PresenceChannel; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast; | ||
|
||
class SignedUpUserEvent | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
private $user; | ||
/** | ||
* Create a new event instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(User $user) | ||
{ | ||
$this->user = $user; | ||
} | ||
|
||
public function getUser() | ||
{ | ||
return $this->user; | ||
} | ||
|
||
/** | ||
* Get the channels the event should broadcast on. | ||
* | ||
* @return \Illuminate\Broadcasting\Channel|array | ||
*/ | ||
public function broadcastOn() | ||
{ | ||
return new PrivateChannel('channel-name'); | ||
} | ||
} |
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\Exports; | ||
|
||
use App\User; | ||
use Illuminate\Contracts\View\View; | ||
use Maatwebsite\Excel\Concerns\FromView; | ||
|
||
class UserExport implements FromView | ||
{ | ||
/** | ||
* @return \Illuminate\Support\Collection | ||
*/ | ||
private $users; | ||
|
||
public function __construct($users) | ||
{ | ||
$this->users = $users; | ||
} | ||
|
||
public function view(): View | ||
{ | ||
return view('exports.UserExport',[ | ||
'users'=>$this->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
Oops, something went wrong.