boyjarv

boyjarv

Member Since 1 Year Ago

Experience Points
2,130
Total
Experience

2,870 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.

Level 1
2,130 XP
May
01
3 weeks ago
Activity icon

Awarded Best Reply on Foreach Within A For Each - Controller Or Blade?

ahhh... I can just use the relationship method:

@foreach($section->sectionphotos as $sectionpics)
                        <img src="{{Storage::url($sectionpics->photo)}}" width="100" />
                    @endforeach
Activity icon

Replied to Foreach Within A For Each - Controller Or Blade?

ahhh... I can just use the relationship method:

@foreach($section->sectionphotos as $sectionpics)
                        <img src="{{Storage::url($sectionpics->photo)}}" width="100" />
                    @endforeach
Activity icon

Replied to Foreach Within A For Each - Controller Or Blade?

where did you get: selection_photos from?

Activity icon

Started a new Conversation Foreach Within A For Each - Controller Or Blade?

Hi, I only want to show all the photos for each section. How can I do this?

here is my blade template:

<ul>
            @foreach($sections as $section)
                <li><a href="{{ route('section.edit', [$section->id]) }}">{{$section->sectionName}}</a> |
                    <a href="{{ route('section.addphotos', [$section->id, $section->sectionSlug]) }}" class="btn btn-dark btn-sm">Add Photos</a>
                    @foreach($photos as $sectionpics)
                        <img src="{{Storage::url($sectionpics->photo)}}" width="100" />
                    @endforeach
                </li>
            @endforeach
            </ul>

in my controller method:

$sections = Section::all();
        $photos = SectionPhotos::all();
        return view('home', compact('sections', 'photos'));

My SectionPhotos has the field section_id which I need to base the filter on

Activity icon

Replied to Route Comes Back 404 Not Found?!

I just worked out, I needed to add into my Section model:

public function getRouteKeyName() {
        return 'sectionSlug';
    }
Activity icon

Started a new Conversation Route Comes Back 404 Not Found?!

Can anyone please help, Why am I getting a 404?

Here is my link:

<a href="{{ route('section.addphotos', [$section->id, $section->sectionSlug]) }}" class="btn btn-dark btn-sm">Add Photos</a>

Here is my route:

Route::get('/section/{id}/{section}/addphotos', '[email protected]')->name('section.addphotos');

Here is my controller method:

public function addPhotos($id, Section $section) {
        $sectionPhotos = SectionPhotos::where('section_id', '=', $id)
            ->get();
        dd($sectionPhotos);
        $params = array_merge(['sectionID' => $id, 'photos' => $sectionPhotos], compact('section'));
        return view('section.addphotos', $params);
    }
Apr
29
4 weeks ago
Activity icon

Replied to Search Not Working?!

thank you!

Apr
28
4 weeks ago
Activity icon

Replied to Search Not Working?!

Still not working?!

and here is my code so far:

if($propname||$minbeds||$proptype_id||$category_id||$town) {
            $properties = Property::where('proptype_id', $proptype_id)
                ->orWhereNotNull('propname', 'LIKE', "%".$propname."%")
                ->orWhereNotNull('bedroom', $minbeds)
                ->orWhereNotNull('category_id', $category_id)
                ->orWhereNotNull('town', $town)
                ->paginate(20);
}

PLEASE HELP?

Activity icon

Replied to Search Not Working?!

now I'm getting this:

Facade\Ignition\Exceptions\ViewException
Call to undefined method Illuminate\Database\Eloquent\Builder::appends()
Activity icon

Replied to Search Not Working?!

So put an IF condition after each line?

Activity icon

Replied to Search Not Working?!

cool thanks!

Activity icon

Replied to Search Not Working?!

select * from `properties` where `proptype_id` is null or `propname` LIKE ? or `bedroom` is null or `category_id` is null or `town` is null

Error 1064 error in SQL syntax

Activity icon

Replied to Search Not Working?!

I can't get the SQL from that

Activity icon

Replied to Search Not Working?!

ok, I am now using the following:

$properties = Property::where('proptype_id', $proptype_id)
                ->orWhere('propname', 'LIKE', "%".$propname."%")
                ->orWhere('bedroom', $minbeds)
                ->orWhere('category_id', $category_id)
                ->orWhere('town', $town)
                ->paginate(20);

but only the propname search works?!

Activity icon

Replied to Search Not Working?!

so what can I use instead of '=' and multiple if statements?

Activity icon

Replied to Search Not Working?!

yes I think it's because I am using '=' and the other requested fields are null?!

Activity icon

Replied to Search Not Working?!

thanks but I am still getting:

InvalidArgumentException Illegal operator and value combination.

Activity icon

Replied to Search Not Working?!

Like how?

Activity icon

Replied to Search Not Working?!

now I get:

InvalidArgumentException
Illegal operator and value combination.
Activity icon

Started a new Conversation Search Not Working?!

Only the first part of my search works?! propname Please help

$properties = Property::where('propname', 'LIKE', "%{$propname}%")
                ->where(static function ($query) use ($proptype_id, $propname, $minbeds, $category_id, $town) {
                    $query->where('proptype_id', '=', $proptype_id)
                        ->orWhere('propname', 'LIKE', "%".$propname."%")
                        ->orWhere('bedroom', '>', $minbeds)
                        ->orWhere('category_id', '=', $category_id)
                        ->orWhere('town', '=', $town);
                })->paginate(20);
Activity icon

Replied to Illegal Operator And Value Combination.

I just figured it out, I can't have '>' on it's own, I had to do '=>'

Activity icon

Started a new Conversation Illegal Operator And Value Combination.

Illegal operator and value combination.

All I did was search a town Brighton:

http://moveme.test/properties/all-properties?bedroom=&category_id=&propname=&proptype_id=&town=Brighton
if($propname||$minbeds||$proptype_id||$category_id||$town) {
            $properties = Property::where('propname', 'LIKE', "%{$propname}%")
                ->where(static function ($query) use ($proptype_id, $propname, $minbeds, $category_id, $town) {
                    $query->where('proptype_id', '=', $proptype_id)
                        ->orWhere('propname', 'LIKE', "%".$propname."%")
                        ->orWhere('bedroom', '>', $minbeds)
                        ->orWhere('category_id', '=', $category_id)
                        ->orWhere('town', '=', $town);
                })->paginate(20);
}
Apr
27
1 month ago
Activity icon

Replied to Each Time I Git Pull I Need To Unlink Storage And Relink

can I stop PLESK from overriding my symlink?

Activity icon

Replied to Each Time I Git Pull I Need To Unlink Storage And Relink

why? is there a way of stopping that from happening?

Apr
26
1 month ago
Activity icon

Started a new Conversation Each Time I Git Pull I Need To Unlink Storage And Relink

The storage folder is in my gitignore, I am running my git pull through PLESK, Does anyone know why I have to login to my server and unlink storage and then relink storage?

Activity icon

Replied to Get Distinct Value On Related Tables

no, I want to display a separate list of distinct towns like the following but for Events

Venue::select('town')->distinct()->get();
Activity icon

Replied to Get Distinct Value On Related Tables

How can I only show the towns for my events list?

Activity icon

Started a new Conversation Get Distinct Value On Related Tables

At the moment, my query gets all towns in the venues table. I would like to only show towns based on Events

Venue::select('town')->distinct()->get();

So my Events are linked on Venue_ID

I would only like to only display the town that the Event is happening in

I am able to show the events town for each event:

{{$event->venue->town}}
Apr
24
1 month ago
Apr
23
1 month ago
Activity icon

Replied to Why Do I Always Have To Relink Storage After Each Git Pull?

ah... I think it's the fact my .gitnore is not working?!

/vendor/
node_modules/
npm-debug.log
yarn-error.log

# Laravel 4 specific
bootstrap/compiled.php
app/storage/


# Laravel 5 & Lumen specific with changed public path
public_html/storage
public_html/hot

storage/*.key
.env
Homestead.yaml
Homestead.json
/.vagrant
.phpunit.result.cache

/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log

.DS_Store
storage.DS_Store

I have tried messing about with the gitignore and the other gitignore files too but still having to unlink and relink storage

Activity icon

Replied to Why Do I Always Have To Relink Storage After Each Git Pull?

How can I find this out? I am using PLESK to deploy my website files to git

Apr
22
1 month ago
Activity icon

Replied to Why Do I Always Have To Relink Storage After Each Git Pull?

Don't think so, PLESK does it automatically?!

Activity icon

Started a new Conversation Why Do I Always Have To Relink Storage After Each Git Pull?

Hi, After every time I do a git pull on my server, I then have to go into my public folder and unlink storage and then go back and then run php artisan storage:link

Why?

Activity icon

Replied to How To Debug A Form?

Thank you everyone for your help guiding me here! It was down to the fact I have a required field and I hadn't added the required part to the actual form field... strange no errors to debug?!

Activity icon

Replied to How To Debug A Form?

I just removed all rules and I can now get to my dd() so I will add them one by one now, thanks for guiding me

Activity icon

Replied to How To Debug A Form?

it's not hitting my DD statement! here is my PropertyPostRequest

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class PropertyPostRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'user_id'=>'required',
            'propname'=>'required|max:45',
            'propcost'=>'required',
            'proptype_id'=>'required',
            'propimage'=>'required',
            'address'=>'required',
            'town'=>'required',
            'county'=>'required',
            'postcode'=>'required',
            'latitude'=>'required',
            'longitude'=>'required',
            'short_summary'=>'required',
            'description'=>'required',
            'summary'=>'required',
            'floorplan'=>'required',
            'brochure'=>'required',
            'last_date'=>'required',
            'category_id'=>'required'
        ];
    }
}

Activity icon

Replied to How To Debug A Form?

Form action:

<form action="{{route('property.store')}}" method="post" enctype="multipart/form-data">@csrf

Route:

Route::post('/property/create', '[email protected]')->name('property.store');

and the URL is: /property/create

This was all working recently until I added extra fields

Activity icon

Replied to How To Debug A Form?

Arrrgh, I reverted back to an earlier commit, still not working... this is so frustrating

Activity icon

Replied to How To Debug A Form?

yes I have version control All I did was add summary_short and summary and I changed the way town is being passed across

Activity icon

Replied to How To Debug A Form?

Form action:

<form action="{{route('property.store')}}" method="post" enctype="multipart/form-data">@csrf

Route:

Route::post('/property/create', '[email protected]')->name('property.store');

and the URL is: /property/create

This was all working recently until I added extra fields

Activity icon

Replied to How To Debug A Form?

redirect should go back: here is my method:

public function store(PropertyPostRequest $request) {
        dd($request->all());
        $user_id = auth()->user()->id;
        $company = Company::where('user_id',$user_id)->first();
        $company_id = $company->id;

        $propertyphoto = $request->file('propimage')->store('public/property/photos');
        $floorplan = $request->file('floorplan')->store('public/property/brochure');
        $brochure = $request->file('brochure')->store('public/property/floorplan');
        $requestedtown = request('town');
        if($requestedtown == ''){
            $requestedtown = request('othertown');
        }
        Property::create([
            'user_id'=>$user_id,
            'company_id'=>$company_id,
            'propname'=>request('propname'),
            'slug'=>str_slug(request('propname')),
            'propcost'=>request('propcost'),
            'proptype_id'=>request('proptype_id'),
            'propimage'=>$propertyphoto,
            'bedroom'=>request('bedroom'),
            'bathroom'=>request('bathroom'),
            'kitchen'=>request('kitchen'),
            'garage'=>request('garage'),
            'reception'=>request('reception'),
            'conservatory'=>request('conservatory'),
            'outbuilding'=>request('outbuilding'),
            'address'=>request('address'),
            'town'=>$requestedtown,
            'county'=>request('county'),
            'postcode'=>request('postcode'),
            'latitude'=>request('latitude'),
            'longitude'=>request('longitude'),
            'short_summary'=>request('short_summary'),
            'summary'=>request('summary'),
            'description'=>request('description'),
            'floorplan'=>$floorplan,
            'brochure'=>$brochure,
            'last_date'=>request('last_date'),
            'category_id'=>request('category_id'),
            'is_featured'=>request('is_featured'),
            'is_live'=>request('is_live')
        ]);

        //LOGGING
        Log::info('Property Name: '.request('propname').'');

        return redirect()->back()->with('message','Property added successfully!');
    }

I don't think it's getting into this method though

Activity icon

Replied to How To Debug A Form?

not sure cos I can't dd(); anything

Activity icon

Replied to How To Debug A Form?

oh yeah it is submitting, I am getting a 302 code

Activity icon

Replied to How To Debug A Form?

thanks but it's not getting to the controller

Activity icon

Started a new Conversation How To Debug A Form?

ok so I recently added a couple of extra fields, for doesn't seem to be getting to my method and submitting, please help?!

How can I debug this?

Apr
19
1 month ago
Activity icon

Replied to No Scheduled Commands Are Ready To Run | Empty

Seems not to work for daily() I changed back to everyMinute() and it worked

Activity icon

Replied to No Scheduled Commands Are Ready To Run | Empty

Argh, I am having this same issue?! - can anyone help?

Activity icon

Started a new Conversation Delete All Entries Less Than Todays Current Date

Here is my code

DB::table('events')->where('eventDate','<=','DATE(CURDATE())')->get();

It is deleting everything even events I have set up with a future date

Please help?

Activity icon

Started a new Conversation The GET Method Is Not Supported For This Route.

Please help,

I am getting: The GET method is not supported for this route. Supported methods: DELETE.

Here is my delete button:

<a href="{{ route('perm.delete', [$event->id]) }}" class="btn btn-outline-danger btn-sm">Perm Delete ({{$event->id}})</a>

Here is my method:

public function permanentDelete($id)
    {
        dd($id);
        $event = Event::destroy($id);
        if ($event) {
            $response = $this->successfulMessage(200, 'Successfully deleted', true, 0, $event);
        } else {
            $response = $this->notFoundMessage();
        }
        return response($response);
    }

Here is my route:

Route::delete('/admin/event/delete/{id}', '[email protected]')->name('perm.delete');