Sergiu17

Sergiu17

Member Since 3 Years Ago

Chisinau

Experience Points
375,970
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
1649
Lessons
Completed
Best Reply Awards
326
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.

Level 50
375,970 XP
Jul
07
1 day ago
Activity icon

Awarded Best Reply on How Can I Get Access To Uploaded File?

https://laravel.com/docs/7.x/filesystem#the-public-disk

run php artisan storage:link, then

href="{{ asset($item->voucher) }}"
Jul
06
2 days ago
Activity icon

Replied to How Can I Get Access To Uploaded File?

https://laravel.com/docs/7.x/filesystem#the-public-disk

run php artisan storage:link, then

href="{{ asset($item->voucher) }}"
Jul
04
4 days ago
Activity icon

Replied to Field 'project_id' Doesn't Have A Default Value | Pass Variable To My Custom Trait

Hi, probably you should add project_id to the fillable array inside Material model

Activity icon

Replied to Getting All Items From Model String

Hi,

(new $resource->model)->all();
Jul
01
1 week ago
Activity icon

Replied to Where To Put {{csrf_field}} In Form Post?

There's no difference at all, most of the time you will find it at the beginning of the form, as in documentation described https://laravel.com/docs/7.x/csrf#csrf-introduction

<form method="POST" action="/profile">
    @csrf
    ...
</form>
Jun
28
1 week ago
Activity icon

Replied to 404 API Route When Route Is Called Through AXIOS Or Insomnia

Route::post('send/group/{id}', '[email protected]');

I don't see anything related to auth before send/group/{id}

Run php artisan route:list to see full details about routes

Jun
27
1 week ago
Activity icon

Awarded Best Reply on Target Class [App\Http\Controllers\] Does Not Exist

All your routes have @ before controller name, you don't need that

https://laravel.com/docs/7.x/routing#basic-routing

// this will work
Route::post("/add", "[email protected]");
Route::get("/get-all/{token}/{pagination?}", "[email protected]");
Route::post("/update/{id}", "[email protected]");
Route::post("/delete/{id}", "[email protected]");
Route::get("/get-single/{id}", "[email protected]");
Route::get("/search/{search}/{token}/{pagination?}", "[email protected]");
Activity icon

Replied to Target Class [App\Http\Controllers\] Does Not Exist

All your routes have @ before controller name, you don't need that

https://laravel.com/docs/7.x/routing#basic-routing

// this will work
Route::post("/add", "[email protected]");
Route::get("/get-all/{token}/{pagination?}", "[email protected]");
Route::post("/update/{id}", "[email protected]");
Route::post("/delete/{id}", "[email protected]");
Route::get("/get-single/{id}", "[email protected]");
Route::get("/search/{search}/{token}/{pagination?}", "[email protected]");
Jun
26
1 week ago
Activity icon

Awarded Best Reply on Delete Modal Not Deleting

@artisticre this is the most important part, formSubmit function should send an AJAX Request to your endpoint, and then close the modal, open browser's console, you may see undefined function fromSubmit

Jun
24
2 weeks ago
Activity icon

Replied to Css And Js Mix

CDN is faster, in your case jQuery, moment and dropzone, I think it's fine with CDN

Activity icon

Replied to Composer

What's your operating system?

Activity icon

Replied to 'res' Is Defined But Never Used

@nickywan123 you installed ESLint, the video tutorial is without it

Activity icon

Awarded Best Reply on 'res' Is Defined But Never Used

axios.delete(`https://jsonplaceholder.typicode.com/todos/${id}`)
        .then(() => this.todos = this.todos.filter(todo => todo.id !== id))

I removed res and replaced it with empty parentheses

Jun
23
2 weeks ago
Activity icon

Replied to 'res' Is Defined But Never Used

axios.delete(`https://jsonplaceholder.typicode.com/todos/${id}`)
        .then(() => this.todos = this.todos.filter(todo => todo.id !== id))

I removed res and replaced it with empty parentheses

Jun
22
2 weeks ago
Activity icon

Replied to Laravel Posting Data Via Ajax

You should add something like e.preventDefault() to your function, by default, browser will submit a 'normal' post request to the endpoint.

Or you could also change the type attribute of the button from your form, from submit to button

Activity icon

Replied to How Can Display Photos That Saved For A Product

public function show(Product $product)
{
	return view('products.show', [
		'product' => $product,
		'images' => $product->images,
	]);
}


// view
@foreach($images as $image)
	<img src="{{ $image->path }}" />
@endforeach

hope this helps

Activity icon

Replied to How To Return Data Method To Template

@euchimed what's the component name of the code above?

Take different approach

<div v-for="store in stores">
	<pannel :store="store.storeId"></pannel>
</div>

something like this

Activity icon

Replied to How To Return Data Method To Template

<div class="card-body" v-for="panel in panels" :key="panel.id">
	{{ panel.name }}
</div>

<script>
export default {
    props: ['stores'],

    data: () => {
        return {
            panels: []
        }
    },

    mounted: () => {
        axios.post('/panel-user', {stores.storeId})
            .then(({data}) => {
               this.panels = data;
            });
    },
}
</script>
Jun
21
2 weeks ago
Activity icon

Awarded Best Reply on Learn Vue 2: Step By Step

Hi, https://laracasts.com/topics/vue , https://vuejs.org/v2/guide/ , and practicing should be enough!

Jun
20
2 weeks ago
Activity icon

Replied to Pagination Not Working In Vue Js

@spiral with an if statement would be simplest solution

<td v-if="job.user">{{ job.user.first_name }} {{ job.user.last_name }}</td>

show user's details of the job only if there's an user.

Activity icon

Replied to Pagination Not Working In Vue Js

This means that there's a job without user.

user console.log for response.data.jobs and see if every single job has an user

Jun
19
2 weeks ago
Activity icon

Awarded Best Reply on Missing Required Parameters For Route

// wrong
{{ route('showProduct'), $productId }}

// correct
{{ route('showProduct', ['product' => $productId) }}
Jun
18
2 weeks ago
Activity icon

Replied to Delete Modal Not Deleting

@artisticre this is the most important part, formSubmit function should send an AJAX Request to your endpoint, and then close the modal, open browser's console, you may see undefined function fromSubmit

Activity icon

Replied to Delete Modal Not Deleting

What does formSubmit function do?

Activity icon

Replied to Missing Required Parameters For Route

// wrong
{{ route('showProduct'), $productId }}

// correct
{{ route('showProduct', ['product' => $productId) }}
Jun
17
3 weeks ago
Activity icon

Awarded Best Reply on Add Load Button While Waiting For Axios To Finish.

Hi, you need a flag for this

// html
<div class='spinner' v-if='isLoading'></div>

<button :disabled='isLoading' type='submit'>Greiða</button>

// js
data: () => {
	return {
		// show spinning icon if isLoading = true
		// by default set it to false
		isLoading: false,
	}
},

methods: {
	createBooking() {
		// set to true, 
		isLoading = true;
		axios.post()
			.then(() =>{})
			.catch(() => {})
			.finally(() => {
				isLoading = false;
			});
	}
},
Activity icon

Awarded Best Reply on Blending Vuejs With Blade

Hi, here's official documentation https://laravel.com/docs/7.x/frontend

when you run php artisan ui vue, a new vue example component is created, then you have to compile npm install && npm run dev

after compilation, public/js/app.js file is created, you include it in your master.blade.php or layout.blade.php however it's called.

Activity icon

Replied to Blending Vuejs With Blade

Hi, here's official documentation https://laravel.com/docs/7.x/frontend

when you run php artisan ui vue, a new vue example component is created, then you have to compile npm install && npm run dev

after compilation, public/js/app.js file is created, you include it in your master.blade.php or layout.blade.php however it's called.

Jun
15
3 weeks ago
Activity icon

Awarded Best Reply on Redirect To Login If Button Is Clicked By Guest User

Use auth middleware

class SubscriptionsController
{
	public function __construct()
	{
		$this->middleware('auth');
	}
}
Activity icon

Replied to Redirect To Login If Button Is Clicked By Guest User

Use auth middleware

class SubscriptionsController
{
	public function __construct()
	{
		$this->middleware('auth');
	}
}
Jun
13
3 weeks ago
Activity icon

Replied to Form Input Disappears On Hitting The Submit Button

@nkativor1999 OK, debug it,

// 1st step
public function store(Request $request)
{
	dd($request->all());
}

// 2nd step
public function store(Request $request)
{
	$this->validate($request, [
		'name' => 'required',
		'description' => 'required',
		'price' => 'required',
	]);

	dd('got called');
}

// 3rd step
public function store(Request $request)
{
	$this->validate($request, [
		'name' => 'required',
		'description' => 'required',
		'price' => 'required',
	]);

	$product = new Product();
	$product->name = $request->input('name');
	$product->description = $request->input('description');
	$product->price = $request->input('price');
	$product->save();

	dd($product);
}
Activity icon

Replied to Add Load Button While Waiting For Axios To Finish.

Hi, you need a flag for this

// html
<div class='spinner' v-if='isLoading'></div>

<button :disabled='isLoading' type='submit'>Greiða</button>

// js
data: () => {
	return {
		// show spinning icon if isLoading = true
		// by default set it to false
		isLoading: false,
	}
},

methods: {
	createBooking() {
		// set to true, 
		isLoading = true;
		axios.post()
			.then(() =>{})
			.catch(() => {})
			.finally(() => {
				isLoading = false;
			});
	}
},
Jun
12
3 weeks ago
Activity icon

Replied to Form Input Disappears On Hitting The Submit Button

@nkativor1999 I think it's related to validation, if the validation fails, then Laravel redirects back to the form, so, make sure you complete all the fields, your code looks OK to me.

Activity icon

Replied to Form Input Disappears On Hitting The Submit Button

@nkativor1999 upload it on imgur.com , then paste the link here, everyone will see it, I may not know the answer, someone else may know

Activity icon

Replied to Login Panel Is Displaying Even When User Is Logged In.

make use of guest middleware - https://laravel.com/docs/7.x/middleware#assigning-middleware-to-routes

Route::get('my-login-page', function () {
    //
})->middleware('guest');
Activity icon

Awarded Best Reply on Checkbox Issues

<label for="customRadio1" - this is duplicated four times

Activity icon

Replied to Checkbox Issues

<label for="customRadio1" - this is duplicated four times

Jun
11
3 weeks ago
Activity icon

Awarded Best Reply on Change Auth Routes.

You should not edit code from vendor directory, it is inside .gitignore file.

the best way I think is to remove Auth::routes() and manually create routes

Route::get('/innskra', 'Auth\[email protected]');
Route::get('/nyskra', 'Auth\[email protected]');
// and so one

To see all Auth Routes, comment everything in web.php, and run php artisan route:list

Activity icon

Replied to Change Auth Routes.

@hjortur17 Auth\ prefix is required, for all controller inside Auth folder

// this is the correct way, with Auth\ prefix
'Auth\[email protected]'`
Activity icon

Replied to Change Auth Routes.

You should not edit code from vendor directory, it is inside .gitignore file.

the best way I think is to remove Auth::routes() and manually create routes

Route::get('/innskra', 'Auth\[email protected]');
Route::get('/nyskra', 'Auth\[email protected]');
// and so one

To see all Auth Routes, comment everything in web.php, and run php artisan route:list

Jun
07
1 month ago
Activity icon

Awarded Best Reply on If Statement In Navbar Link

@if
  <a class="dropdown-item" href="#">Dashboard</a>
@endif
<a class="dropdown-item" href="{{ $condition ? '/dasboard' : '/' }}">Dashboard</a>
Jun
06
1 month ago
Activity icon

Replied to Absolute Path In Laravel 7 ?

You should setup your document root to /laravel/public on your server, and everything will work.

In your browser, try to update src of any image like so:

// should work I guess
<img src="/laravel/public/assets/img/profile-thumbnail.png" alt="">
Jun
05
1 month ago
Jun
03
1 month ago
Activity icon

Awarded Best Reply on Confused About One Thing In Laravel From Scratch, Ep58

@irfanrufi sure

// something like this
auth()->user()->follows()->save($user);
Activity icon

Replied to Confused About One Thing In Laravel From Scratch, Ep58

@irfanrufi sure

// something like this
auth()->user()->follows()->save($user);