Wygekas

Member Since 6 Months Ago

Experience Points
460
Total
Experience

4,540 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
0
Lessons
Completed
Best Reply Awards
0
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 1
460 XP
Apr
06
1 month ago
Activity icon

Awarded Best Reply on No Permissions To Folders Created By Www-data

SOLVED: Turns out i forgot that my observer which fired when new user was created, had mkdir where i specified 700 permissions, i changed for testing to 0777, now works.

  • I updated my question to specify that user is for Laravel website user/customer
Activity icon

Replied to No Permissions To Folders Created By Www-data

SOLVED: Turns out i forgot that my observer which fired when new user was created, had mkdir where i specified 700 permissions, i changed for testing to 0777, now works.

  • I updated my question to specify that user is for Laravel website user/customer
Activity icon

Started a new Conversation No Permissions To Folders Created By Www-data

When new user is registered in Laravel website, my website creates new folder for that user and inserts default avatar. BUT when new user is registered, that folder has no permissions (d-w-r-sr-T and belongs to user: www-data group: www-data). How can i define what kind of permissions folder should have when created new by system?

Activity icon

Awarded Best Reply on Unable To Save Files In Production Server

SOLVED: Problem was two copies of storage. When deploying project, GIT doesn't provide symlink to storage from public folder, that shortcut he made into folder itself. When deploying you must recreate symlink.

  • It is bad practice to upload storage with GIT to GITHUB
Activity icon

Replied to Unable To Save Files In Production Server

SOLVED: Problem was two copies of storage. When deploying project, GIT doesn't provide symlink to storage from public folder, that shortcut he made into folder itself. When deploying you must recreate symlink.

  • It is bad practice to upload storage with GIT to GITHUB
Apr
05
1 month ago
Activity icon

Started a new Conversation Unable To Save Files In Production Server

Hi, im trying to save user inserted images to my storage but it is not working.

File upload snippet:

$file->storeAs("/public/all_users/".Auth::id()."/", "profile_image.".$file->getClientOriginalExtension());

I also tried another way to save files:

Storage::put("public/storage/all_users/".Auth::id()."/profile_image.".$file->getClientOriginalExtension() , $file);

I also use database to get path to image and display, it is working as intended. Laravel is unable to write to my all_users folder (using filezila i confirmed that)

  • I don't get any errors
  • Website is hosted on DigitalOcean droplet ubuntu 20.04
  • My absolute path to all_users folder: /var/www/MYPROJECT/public/storage/all_users/user_id/ image.jpg
Feb
05
3 months ago
Activity icon

Awarded Best Reply on Dynamic Form Action With Method GET

I did kinda solve this.

<form action="localhost/ads_list/index" method="GET">

For some strange reasons it returns show method, not index. I tried some other variations, but this was the only one that worked. This way i can access at least one method of resource controller and have all variables in URL. Using localhost.ads_list.index or similar variations return 404 error.

Activity icon

Replied to Dynamic Form Action With Method GET

I did kinda solve this.

<form action="localhost/ads_list/index" method="GET">

For some strange reasons it returns show method, not index. I tried some other variations, but this was the only one that worked. This way i can access at least one method of resource controller and have all variables in URL. Using localhost.ads_list.index or similar variations return 404 error.

Feb
04
3 months ago
Activity icon

Started a new Conversation Dynamic Form Action With Method GET

Im making car ads web part. User in form can choose what make he is looking for, model, year ..... So i need to assemble URL with selections which controller could process later. This is my blade:

<form action="{{route('ads_list.index') }}" method="GET">
	<label>Make</label>
	<select id="makes_select" name="make_id">
		<option>SAAB</option>
		<option>TRIUMPH</option>
		<option>LOTUS</option>
	</select>  

	<select id="year_select" name="year">
		<option>2000</option>
		<option>2001</option>
		<option>2002</option>
	</select> 
<button type="submit"> SUBMIT </button>
</form> 

This is my routes

Route::resource('localhost' ,App\Http\Controllers\Skelbimai_mainController::class); //here i choose filters
Route::resource('localhost/ads_list' ,App\Http\Controllers\Ads_listController::class); //here i want display ads according to filters

If i submit data i selected in form, I get redirected to intended route ads_list with all variables in URL (localhost/ads_list?make_id=SAAB&year=2000). BUT my resource controller doesn't return anything, it's just blank page (they should return("damn this works"). According to route:list route exist and is correct, just all those extra values to URL messes up something. If i simply add csrf and change method to POST i do get controller return value, but then URL won't have variables.

Jan
24
3 months ago
Activity icon

Started a new Conversation Attempt To Read Property "make" On Array

Hi, WHAT IM TRYING TO ACCOMPLISH: fetch data from collection like that:

//this is my controller
$cars = cars::all();

Filter collection $cars according to different filters and assign to different variables. (in short, one query for multiple variables with different data)

WHAT WORKS: If i return $cars collection to view with name "makes" i do this:

//this is my view
<ul>
@foreach($makes as $i)
<li> <img src= "{{$i->make_image}}"> {{$i->make}}</li>
@endforeach
</ul>

Everything is kinda fine, BUT i send more data to view than necessary (there is more columns than those two). I want from that single query strip unnecessary data and assign what's left to variable and pass it to view. (i did make query that would return only specific rows and columns, but i would have to run multiple queries so i need solution with single query)

WHAT I TRIED:

//this is my controller
$all_makes = $cars->map(function($cars){
 return [
'id'=>$cars->id,
'make'=>$cars->make, 
'model'=>$cars->model, 
'made_from'=>$cars->made_from, 
'made_to'=>$cars->made_to, 
'requested'=>$cars->requested,
'make_image' => $cars->make_image,
'model_image' => $cars->model_image,
'created_at' => $cars->created_at,
'updated_at' => $cars->updated_at
];

I mapped every single column in table, the same as $cars = cars::all() does. if i return cars::all() and array that i mapped i get exactly the same data between the two ($all_makes==cars::all()). Except $cars=cars::all() i can use in view, but mapped array $all_makes i CANT if i do i get error "Attempt to read property "make" on array". It seems that type of array changed.

Activity icon

Awarded Best Reply on Weird Path To Image From Database

I made a mistake, I tried path with backslash and forward slash together, it does work too. Problem is elsewhere. Post can be deleted... facepalm

Activity icon

Replied to Weird Path To Image From Database

I made a mistake, I tried path with backslash and forward slash together, it does work too. Problem is elsewhere. Post can be deleted... facepalm

Activity icon

Started a new Conversation Weird Path To Image From Database

Hi, what im trying: display images in view that are provided from database (database has column with path to images stored in storage)

When i check what data i get when accessing from database:

return Cars::all();

i get:

make_image":"storage\/make_images\/SAAB.jpg"

Why i get this weird backslash thing in path? in database paths are inserted ok and if i plug it into view directly it works

<img src="storage/make_images/SAAB.jpg" width="50px" height="50px"> 

I suspect this weird backslash is the culprit of my problems? Im not getting any errors