Sergiu17

Member Since 3 Years Ago

Chisinau

Experience Points
496,350
Total
Experience

0 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
1883
Lessons
Completed
Best Reply Awards
483
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    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.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 50
496,350 XP
Jun
12
1 day ago
Activity icon

Replied to How To Access Object Inside Object In Laravel Blade File ?

You can debug this then,

// 1
          @foreach ($applicant_infos['universities'] as $university)
             dd(university);
          @endforeach
// 2
          @foreach ($applicant_infos['universities'] as $university)
             dd(university->course);
          @endforeach

or use dump instead of dd to see results of each iteration, some courses may not have name, idk what could be exactly

it's not working.

also, this is too generic, do you get errors? or something? not working is not clear

Activity icon

Replied to Disable Notifications From Ignored Users

You should not modify code from vendor directory, either in each event listener or create a new class and overwrite notify method, and each event will extend from the created class

Activity icon

Replied to How To Access Object Inside Object In Laravel Blade File ?

          @foreach ($applicant_infos['universities'] as $university)
             <li>{{ $university->course->course_name }}</li>
          @endforeach
Jun
11
2 days ago
Activity icon

Replied to Parameter Not Required In __construct Of API Resource

public function __construct($resource, $foo = null)

Assign it a default value, like null or false

Jun
08
5 days ago
Activity icon

Awarded Best Reply on Getting Error While Testing

I'm not 100% sure, but try this

$response = $this->withHeaders($this->headers)
	->json('put', route('user.create'), [
        'name' => 'Samandar Mirakhmedov',
        'email' => '[email protected]',
        'password' => '123123321',
        'password_confirmation' => '123123321'
    ]);
Activity icon

Replied to Getting Error While Testing

I'm not 100% sure, but try this

$response = $this->withHeaders($this->headers)
	->json('put', route('user.create'), [
        'name' => 'Samandar Mirakhmedov',
        'email' => '[email protected]',
        'password' => '123123321',
        'password_confirmation' => '123123321'
    ]);
Jun
07
6 days ago
Activity icon

Replied to Property [media] Does Not Exist On This Collection Instance.

$pages = Pages::with('media')->get();

@foreach($pages as $page)
	@foreach($page->media as $media)
		// 
	@endforeach
@endforeach

or

$pages = Pages::with('media')->first();

@foreach ($pages->media as $media)
	//
@endforeach
Jun
04
1 week ago
Activity icon

Replied to Show A Single Button In A V-for

HI, v-if="index === 0"

Activity icon

Awarded Best Reply on Register The Search

Hi, if you mean for example filtering posts or products, then create a new table user_searches, with id, user_id, search, type

public function search(Request $request) {
	$search = UserSearch([
		'user_id' => auth()->id(),
		'search' => json_encode($request->validated()),
		'type' => 'App\Models\Post'
	])
}

something like this

Activity icon

Replied to Register The Search

Hi, if you mean for example filtering posts or products, then create a new table user_searches, with id, user_id, search, type

public function search(Request $request) {
	$search = UserSearch([
		'user_id' => auth()->id(),
		'search' => json_encode($request->validated()),
		'type' => 'App\Models\Post'
	])
}

something like this

May
31
1 week ago
Activity icon

Awarded Best Reply on Target Class [SessionController] Does Not Exist.

@rafaeladi I don't even see PagesController in your routes.php file

Make sure it's the right controller

May
28
2 weeks ago
Activity icon

Awarded Best Reply on Get From Database With Condition

https://laravel.com/docs/8.x/eloquent

https://laravel.com/docs/8.x/queries

here's the entire documentation

DB::table('table')
	->where('something', 'something')
	->orWhere('something', 'something_else')
	->get();

or use whereIn

whereIn('something', ['something', 'something_else'])->get();
Activity icon

Replied to Get From Database With Condition

https://laravel.com/docs/8.x/eloquent

https://laravel.com/docs/8.x/queries

here's the entire documentation

DB::table('table')
	->where('something', 'something')
	->orWhere('something', 'something_else')
	->get();

or use whereIn

whereIn('something', ['something', 'something_else'])->get();
Activity icon

Replied to Controller Not Exist Error

try this

Route::resource('requisitions', App\Http\Controllers\RequisitionController::class);
Activity icon

Replied to Get From Database With Condition

\DB::table('my_table_name')->where('something', 'something')->oderByDesc('name')->get()
Activity icon

Replied to Why Foreach Loop Exit First Element In Controller

public function resume(Work $work) {
	$employees = $work->employees;

	dd($employees->count());

what do you get if you count them?

May
27
2 weeks ago
Activity icon

Replied to Target Class [SessionController] Does Not Exist.

Yes, a return back() will do the work

Activity icon

Replied to Target Class [landlordSeeder] Does Not Exist.

Try with uppercase L, LandlordSeeder, not landlordSeeder

Activity icon

Replied to Target Class [SessionController] Does Not Exist.

@rafaeladi I don't even see PagesController in your routes.php file

Make sure it's the right controller

Activity icon

Replied to Target Class [SessionController] Does Not Exist.

Route::get('session/set',[App\Http\Controllers\SessionController::class,'store'])->name('store.sessions');

or

use App\Http\Controllers\SessionController;

Route::get('session/set',[SessionController::class,'store'])->name('store.sessions');

try this

Activity icon

Replied to Fetching Issue

use whereNotIn

->whereNotIn('field', ['INACTIVE'])
May
24
2 weeks ago
Activity icon

Replied to Testing - Single Test Feature

phpunit tests/Feature/UserTest.php

and this?

Activity icon

Replied to Testing - Single Test Feature

try this

php artisan test --filter=UserTest
May
20
3 weeks ago
Activity icon

Awarded Best Reply on Access To Undeclared Static Property

your variable isn't static

public static $what_update_type_arr = [];
May
19
3 weeks ago
Activity icon

Replied to Access To Undeclared Static Property

your variable isn't static

public static $what_update_type_arr = [];
May
12
1 month ago
Activity icon

Replied to Separate With "/" A Number Dynamically

$input = '124125236347373';

$chunks = str_split($input, 3);

$result = implode('/', $chunks);

one way to do it

Activity icon

Replied to How To Get The Foreign Key From Model Relationship And Use To Retrieve Database?

use with

$posts = Posts::with('user')
// ...
@foreach($posts as $post)
	{{ $post->user->name }}
@endforeach
Activity icon

Awarded Best Reply on Routing Error

The extra space between admin and mall ?! next, your form says method='post' but your route is defined as get, then your save method doesn't include the id wildcard from the route

Activity icon

Replied to Routing Error

The extra space between admin and mall ?! next, your form says method='post' but your route is defined as get, then your save method doesn't include the id wildcard from the route

May
11
1 month ago
Activity icon

Replied to Search Relations WhereHas

Here's the function declaration https://laravel.com/api/5.8/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.html#method_whereHas

https://github.com/laravel/framework/blob/5.8/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php#L144

// 1st parameter is the relationship,
// 2nd parameter is the callback, but you passed a string, that's you get the error
whereHas(string $relation, Closure $callback = null, string $operator = '>=', int $count = 1)
May
06
1 month ago
Activity icon

Awarded Best Reply on Lodash Functions Not Working.

Your code looks OK, make sure that lodash is imported and it's last version,

try this with CDN

<script src="https://cdn.jsdelivr.net/npm/[email protected]/lodash.min.js"></script>
May
05
1 month ago
Activity icon

Awarded Best Reply on Div Background Colours Visible Past Rounded Corners

add to your div rounded-md

<div class="overflow-hidden flex bg-white shadow-lg rounded-md">
Activity icon

Replied to Div Background Colours Visible Past Rounded Corners

add to your div rounded-md

<div class="overflow-hidden flex bg-white shadow-lg rounded-md">
Activity icon

Awarded Best Reply on Errno: 150 Foreign Key Constraint Is Incorrectly Formed In Migration

try this

$table->unsignedBigInteger('user_id');

foreign key and reference key should have the same length and type

Activity icon

Replied to Errno: 150 Foreign Key Constraint Is Incorrectly Formed In Migration

try this

$table->unsignedBigInteger('user_id');

foreign key and reference key should have the same length and type

Activity icon

Replied to Tinker Error When Creating User Data

use Illuminate\Database\Eloquent\Factories\HasFactory;
class User {
	use HasFactory;
}

Add HasFactory Trait to your User model

Activity icon

Replied to Pay Via Debit Card

https://laracasts.com/paypal

You can use PayPal, to pay for one year

Activity icon

Replied to Lodash Functions Not Working.

Your code looks OK, make sure that lodash is imported and it's last version,

try this with CDN

<script src="https://cdn.jsdelivr.net/npm/[email protected]/lodash.min.js"></script>
May
04
1 month ago
Activity icon

Awarded Best Reply on Vue Axios .catch() Doesn't Stop The Method

// Make a request for a user with a given ID
axios.get('/user?ID=12345')
  .then(function (response) {
    // handle success
    console.log(response);
  })
  .catch(function (error) {
    // handle error
    console.log(error);
  })
  .then(function () {
    // always executed
  });

code above is from documentation, last then is always executed

so, to fix your problem

axios.post()
	.then()
	.catch()
Activity icon

Replied to Vue Axios .catch() Doesn't Stop The Method

// Make a request for a user with a given ID
axios.get('/user?ID=12345')
  .then(function (response) {
    // handle success
    console.log(response);
  })
  .catch(function (error) {
    // handle error
    console.log(error);
  })
  .then(function () {
    // always executed
  });

code above is from documentation, last then is always executed

so, to fix your problem

axios.post()
	.then()
	.catch()
May
01
1 month ago
Activity icon

Replied to How Do You Access The Loop Index On A Foreach Loop Outside The Blade Template?

foreach($collection as $index => $item)

you mean this?