3,830 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
Started a new Conversation Make A Complex String From An Array In Php
Here is the array:
$array = [
'q' => 'keyword',
'challenge' => ['esse', 'ea', 'du'],
'career' => ['ipsum', 'eos'],
'industry' => ['aut', 'rem'],
'gender' => ['male', 'female'],
'age' => ['28']
];
This is the string I want to build from the array:
keyword OR ((challenge:esse OR ea OR du) AND (career:ipsum OR eos) AND (industry: aut OR rem)) OR ((gender:male OR female) AND (age: 29))
Is it possible?
Replied to Take Specific Column From Multi-dimensional Arra
ok I found the solution.
$collection->map->only('company_name', 'position');
Started a new Conversation Take Specific Column From Multi-dimensional Arra
I have this collection of data.
[
{
"id": 2,
"user_id": 11,
"company_name": "Langosh Ltd",
"position": "Junior",
"created_at": "2020-10-19T07:21:09.000000Z"
},
{
"id": 3,
"user_id": 11,
"company_name": "ABC",
"position": "Senior",
"created_at": "2020-10-19T07:21:09.000000Z"
}
]
I want to take only 'company_name' and 'position' from this collection. So it will be like this:
[
{
"company_name": "Langosh Ltd",
"position": "Junior"
},
{
"company_name": "ABC",
"position": "Senior"
}
]
``
Started a new Conversation How To Get Authenticated User In Repository Pattern?
I did this, but not working.
class PostsEloquentRepository implements PostsRepositoryInterface
{
public $auth;
public function __construct(Guard $auth)
{
$this->auth = $auth;
}
public function getUser(Guard $auth)
{
return $this->auth->user(); //it returns null
}
public function create(array $data)
{
return $this->auth->user()->create($data); //this is also not working
}
}
In the AppServiceProvider.php:
$this->app->bind(PostsRepositoryInterface::class, function() {
return new PostsEloquentRepository(
$this->app->make('Illuminate\Contracts\Auth\Guard')
);
});
How can I access authenticated user in PostsEloquentRepository class?