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
<ul class="submenu"> | |
<li><a href="/courses?type=2">مدارس بین المللی</a></li> | |
<li><a href="/courses?type=1">دورههای زبان</a></li> | |
<li><a href="/courses?type=3">دانشگاهها</a></li> | |
<li><a href="/courses?type=4">دورههای کاربردی و تابستانی</a></li> | |
</ul> |
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
<?php | |
public function getFirstNameAttribute($value) | |
{ | |
return ucfirst($value); | |
} |
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
<?php | |
$user = App\Member::create([ | |
'first_name' => 'saeed', | |
'last_name' => 'nasiri', | |
'email' => 'saeed.nasiri@gmail.com', | |
'password' => '!supersecretpassword!', | |
'last_login' => Carbon\Carbon::now(), | |
'settings' => ['two_factor_aut' => false, 'session_time' => 1200], | |
'created_at' => Carbon\Carbon::now(), | |
'updated_at' => Carbon\Carbon::now() |
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
<?php | |
use Illuminate\Database\Eloquent\Model; | |
/** | |
* Class Member | |
* @package App | |
*/ | |
class Member extends 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
<?php | |
/** | |
* Get members full name | |
* | |
* @return string | |
*/ | |
public function getFullNameAttribute() | |
{ | |
return ucfirst($this->first_name) . ' ' . ucfirst($this->last_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
<?php | |
$member = App\Member::find(1); | |
echo $member->full_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
<?php | |
/** | |
* Custom format for the last login date | |
* | |
* @param $value | |
* @return string | |
*/ | |
public function getLastLoginAttribute($value) | |
{ | |
return \Carbon\Carbon::parse($value)->format('d.m.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
<?php | |
$member = App\Member::find(1); | |
echo $member->last_login; |
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
<?php | |
/** | |
* Make sure that first name is capitalized BEFORE saving it to the database | |
* | |
* @param $value | |
* @return string | |
*/ | |
public function setFirstNameAttribute($value) | |
{ | |
$this->attributes['first_name'] = ucfirst($value); |
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
<?php | |
public function setPasswordAttribute($value) { | |
$this->attributes['password'] = Hash::make($value); | |
} |
OlderNewer