Alidnet

Alidnet

Member Since 7 Months Ago

Experience Points
5,800
Total
Experience

4,200 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
54
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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 2
5,800 XP
Oct
08
1 week ago
Activity icon

Replied to Json Structure From Controller

I tried that but i get message: "array_merge(): Argument #1 is not an array" below are my queries

        $Props = DB::table('hq_to_manco')
        ->join('unit', 'unit.id', '=', 'hq_to_manco.unitid')
        ->join('property', 'property.id', '=', 'unit.propid')
        ->join('masterarea', 'masterarea.id', '=', 'property.areaid')
        ->join('masterregion', 'masterregion.id', '=', 'masterarea.region_id')
        ->leftJoin('portfolios_propcheck', 'portfolios_propcheck.propid', '=', 'property.id')
        ->distinct('unit.propid')
        ->select('property.id as propid', 'property.address', 'masterarea.area', 'masterregion.region', 'portfolios_propcheck.isactive' )
        ->where('hq_to_manco.PORTID', '=', $id)
        ->where('hq_to_manco.isActive', '=', '1')
        ->orderBy('masterregion.region', 'desc')
        ->get();    

        $PropIds = $Props ->pluck('propid');  

        $PropPics = DB::table('hq_to_manco')
        ->join('unit', 'unit.id', '=', 'hq_to_manco.unitid')
        ->join('property', 'property.id', '=', 'unit.propid')
        ->leftJoin('gallery', 'gallery.propid', '=', 'property.id')
        ->leftJoin('portfolios_propcheck', 'portfolios_propcheck.propid', '=', 'property.id')
        ->distinct('unit.propid')
        ->select('property.id as propid', 'gallery.image' )
        ->whereIn('property.id', $PropIds)
        ->where('hq_to_manco.isActive', '=', '1')
        ->where('gallery.webpic', '=', '1')
        ->where('gallery.type', '=', '3')
        ->get();

        $Units = DB::table('hq_to_manco')
        ->join('unit', 'unit.id', '=', 'hq_to_manco.unitid')
        ->leftJoin('users', 'users.id', '=', 'unit.activebroker')
        ->select('unit.*', 'users.photo', 'users.name', 'users.surname', 'hq_to_manco.hqid')
        ->whereIn('unit.propid', $PropIds)
        ->where('hq_to_manco.portid', '=', $id)
        ->where('hq_to_manco.isActive', '=', '1')
        ->where('unit.deleted', '=', '0')
        ->orderBy('unit.id', 'desc')
        ->get();

$ProUni = array_merge($Props,$Units);
        $final= array_merge($ProUni,$PropPics);
Activity icon

Started a new conversation Json Structure From Controller

Sorry if this in an obvious question, I'm trying to achieve the below result json from a function within a controller, the data will come from 3 separate tables, property, units, images.

I'm not sure how to approach this, any help will be greatly appreciated.

{
    "property": {
        "id": "1",
        "address": "123 Street1",
        "units": [{
                "unitid": "1",
                "propid": "1",
                "name": "suite 1",
                "size": 500
            },
            {
                "unitid": "2",
                "propid": "1",
                "name": "suite 2",
                "size": 200
            },
            {
                "unitid": "3",
                "propid": "1",
                "name": "suite 3",
                "size": 340
            }
        ],
        "images": [{
                "imageid": "1",
                "propid": "1",
                "src": "Images/Sun.png",
                "name": "sun1"
            },
            {
                "imageid": "2",
                "propid": "1",
                "src": "Images/Sun2.png",
                "name": "sun2"
            },
            {
                "imageid": "3",
                "propid": "1",
                "src": "Images/Sun3.png",
                "name": "sun3"
            }
        ]
    }
}
Oct
01
2 weeks ago
Activity icon

Started a new conversation Trigger An Email From A Function In A Controller

Hi, I want to send an email when something is changed to false in my controller function, what is the best way to do so?

Sep
19
3 weeks ago
Activity icon

Replied to Complex Search From A Form In Vue And Results From Laravel

@sti3bas THANK YOU SO MUCH, finally it works

Activity icon

Replied to Complex Search From A Form In Vue And Results From Laravel

@sti3bas Thank you for the direction, I will try that now.

Activity icon

Replied to Complex Search From A Form In Vue And Results From Laravel

from my vue... not sure if im doing it right but just testing as per below.

       loadProps() {

                        let forsale= '1';
                        let tolet= '';
                        let areas = "62, 63, 65"; 

                axios.get('../api/property/advancesearch?forsale='+forsale+"&tolet="+tolet+"&areas="+areas)
                .then(({ data }) => (this.props = data));
            },
Activity icon

Replied to Complex Search From A Form In Vue And Results From Laravel

I think I'm slowly making progress, getting stuck on passing my area array request into the query, it only returns results from the first area id

        public function index()
    {        
        
        $forsale = \Request::get('forsale');
        $tolet = \Request::get('tolet');
        $areas = \Request::get('areas');
        $areas = str_replace("%27","'",$areas);
        $areatest[] = '62, 63, 65';
        $unittype[] = "";

        $Properties = DB::table('unit')
        ->join('property', 'property.id', '=', 'unit.propid')
        ->join('masterarea', 'masterarea.areaid', '=', 'property.areaid')
        ->join('masterzone', 'masterzone.zoneid', '=', 'masterarea.zoneid')
        ->join('masterregion', 'masterregion.regionid', '=', 'masterarea.regionid')
        ->select('unit.id', 'unit.unit', 'unit.tolet', 'unit.forsale', 'unit.type', 'property.address', 'property.grade', 'property.type as proptype', 'masterarea.Area', 'masterzone.zone', 'masterregion.region')
        ->whereIn('property.areaid', [$areatest])
        ->whereIn('unit.type', ['Industrial','Retail'])
        ->where('unit.forsale','=', "$forsale")
        ->where('unit.tolet','=', "$tolet")
        ->orderBy('property.id')
        ->paginate(5000);

        return $Properties; 
        
    }

Sep
18
4 weeks ago
Activity icon

Replied to Complex Search From A Form In Vue And Results From Laravel

Thank you @sti3bas so much for your help thus far. This is the part that confuses me, I'm not sure what the request should look like. I have the below for a text search but that's just one query. and how do I bring in the requested area, unittype, forsale, tolet into my controller query.

let query = this.search;
              axios.get('../api/property/advsearch?q=' + query)
              .then((data) => {
                  this.props = data.data
              })
Sep
17
4 weeks ago
Activity icon

Replied to Complex Search From A Form In Vue And Results From Laravel

I have not really got it worked out, struggling to piece it all together, this is what i have so far

<div class="card shadow m-0 p-2">
            <form @submit.prevent="searchProp()">
                <div>
                <multiselect v-model="value" tag-placeholder="Add this as new tag" placeholder="Search for Area's" label="Area, region" track-by="AreaID" :options="options" :multiple="true" :taggable="true" @tag="addTag"></multiselect>
                <pre class="language-json"><areaid>{{ value }}</areaid></pre>
                </div>
            <div>
                <label><input type="checkbox" v-model="forsale"><span>For Sale</span></label>
                <label><input type="checkbox" v-model="tolet"><span>To Let</span></label>
            </div>
            <div>
               <label><input type="checkbox" v-model="unittype"><span>Office</span></label>
               <label><input type="checkbox" v-model="unittype"><span>Industrial</span></label>
               <label><input type="checkbox" v-model="unittype"><span>Retail</span></label>
               <label><input type="checkbox" v-model="unittype"><span>Land</span></label>
               <label><input type="checkbox" v-model="unittype"><span>Residential</span></label>
            </div><div>
               <input type="text" class="form-control" v-model="minsize" placeholder="Min Size">
               <input type="text" class="form-control" v-model="maxsize" placeholder="Max Size">
               <button class="btn btn-warning text-white pull-right" type="submit">Search</button>
            </div>
            </form>
</div>

Activity icon

Replied to Complex Search From A Form In Vue And Results From Laravel

Thanks @sti3bas, unfortunately i dont have the budget yet for Algolia.

I was looking to do a search like this

    $Properties = DB::table('unit')
    ->join('property', 'property.id', '=', 'unit.propid')
    ->join('masterarea', 'masterarea.areaid', '=', 'property.areaid')
    ->join('masterzone', 'masterzone.zoneid', '=', 'masterarea.zoneid')
    ->join('masterregion', 'masterregion.regionid', '=', 'masterarea.regionid')
    ->select('unit.id', 'unit.unit', 'unit.tolet', 'unit.forsale', 'unit.type', 'property.address', 'property.grade', 'property.type as proptype', 'masterarea.Area', 'masterzone.zone', 'masterregion.region')
    ->whereIn('property.areaid', [61, 62, 69])
    ->whereIn('unit.type', ['Commercial', 'Retail'])
    ->where('unit.forsale','=', '')
    ->where('unit.tolet','=', '')
     ->paginate(500);

    return $Properties;

but im not sure how to 1 pass the requests from a vue form to my controller via axios and to how to use the desired requests in my query

Sep
16
1 month ago
Activity icon

Started a new conversation Complex Search From A Form In Vue And Results From Laravel

Hi All, can anyone point me to a tutorial or example that can help me get my head around a complex search. Im new to both Vue and Laravel and I need to do the following.

I need property search form with multiple tag search for areas, tick boxes for property type (Office, Industrial, Residential, etc), Min Size to Max size.

Any help will be appreciated.

Sep
03
1 month ago
Activity icon

Started a new conversation Vue Search Select With 16k + Options

Hi, I'm looking for a way to have a select that I can search on but I have 16k options that are returned for Laravel back end via axios, I cant find an efficient way to do this

Any direction would be greatly appreciated

Aug
06
2 months ago
Activity icon

Replied to Get ID Of Posted Item To Use In Next Post

Thanks Lenophie

That's exactly what i was looking for... Much appreciated.

Activity icon

Started a new conversation Get ID Of Posted Item To Use In Next Post

Hi

Im trying to find a way to post data to 2 tables, the first table needs to post the form data but the second post needs to post the Auto generated ID from the first post.... how do I get that ID after the first post to use in the second post.

Below is how i am posting to both tables

  addNewUnit() {
        this.$Progress.start();
        this.form.post('/api/property/unit')
        .then(() => {
            this
        this.form.post('/api/property/unit/newowner');
        Fire.$emit('AfterChange');
        $('#addunit').modal('hide');
            toast.fire({
            type: 'success',
            title: 'Unit Added Successfully'
            });
        this.$Progress.finish();
         })
            .catch(() => {
            })
        },