Melodia

Melodia

at Home

Member Since 2 Years Ago

Cape Town

Experience Points
21,130
Total
Experience

3,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
159
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 5
21,130 XP
Jan
24
4 months ago
Activity icon

Replied to What Can I Do As A Course Project With Laravel And Vue

Got it. I was thinking of the University management system. I am living in South Africa and noticed that somewhat these systems always lack something. But on the other hand, lectures are quite picky and complain when we do things that according to them already exist.

During my Diploma, I had built a library system, back then in Java, and my lecturer had mentioned to not like the fact that I did something that already exists out there in many places. :(

Activity icon

Started a new Conversation What Can I Do As A Course Project With Laravel And Vue

After throwing a few years of experience in PHP I am now deciding to go back to university and finish my tertiary education with an Advanced Diploma in application development, however, I am running out of ideas regarding a course project.

Anything that I can possibly create/innovate using Laravel and Vue?

Jan
15
4 months ago
Activity icon

Replied to I Have Valet Installed, But My Foobar.test Isn't Pinging

I had the valet folder in my vendor because I forgot the global command when reinstalling it with composer. So I removed from the composer.json and ran composer update. From the laravel folder, which is where all my laravel sites are, I installed valet globally and then ran valet install.

~laravel ~laravel cd projectname ~projectname valet link foobar A [foobar] symbolic link has been created in [/Users/user/.config/valet/Sites/foobar].

When I hit the url: project1.test. I still saw the same result: The page loads for a while before it tells me that the site could not be reached.

Jan
14
4 months ago
Activity icon

Started a new Conversation I Have Valet Installed, But My Foobar.test Isn't Pinging

I am having trouble to use valet.

This is all about my brew services:

➜  project1 git:(master) ✗ brew services list
Name      Status  User Plist
dnsmasq   started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
mariadb   error   user /Users/user/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
[email protected] started user /Users/user/Library/LaunchAgents/[email protected]
nginx     started root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php       started root /Library/LaunchDaemons/homebrew.mxcl.php.plist
➜  project1 git:(master) ✗

If I type valet, it prompts me for the password and then I see the result:

➜  project1 git:(master) ✗ valet
Password:
Laravel Valet 2.8.1

Usage:
command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
   --ansi            Force ANSI output
   --no-ansi         Disable ANSI output

...

Also, If I type valet parked, I see all my parked sites, like:

http://project1.test

But when I hit project1 url, It says that the page cant be reached.

I parked all the sites under a folder named laravel. If I try to ping foobar.test from that folder, it says the following:

ping: cannot resolve foobar.test: Unknown host

And now, I started the project using artisan serve, when I hit the url uring the IP address, I see the following errors:

Notice: Undefined index: HOME in 
/Users/user/Desktop/Sites/laravel/project1/vendor/laravel/valet/cli/includes/helpers.php on 
line 13

Notice: Undefined index: HOME in 
/Users/user/Desktop/Sites/laravel/project1/vendor/laravel/valet/cli/includes/helpers.php on 
line 17
this is the homepage:

I assume this is all has to do with valet.

How can I fix the valet issue?

Activity icon

Replied to Spatie Sitemap Generates Xml File But No Link Is Added

@snapey I have this in the route:

Route::get('map', function() {

    SitemapGenerator::create(env('APP_URL'))->writeToFile('sitemap.xml');
    return "sitemap generated";
    
});

And this is the app url in the .env file:

APP_URL=http://127.0.0.1:8000

When I hit the map url, I see the same result saying sitemap generated, when I visit the xml, I see the following

<?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
</urlset>
Jan
13
4 months ago
Activity icon

Started a new Conversation Spatie Sitemap Generates Xml File But No Link Is Added

How do I use sitemap in laravel?

I'm trying to use spatie sitemap package but am running into a few problems. First, when I added the following code and hit the url, the sitemap file is created but not url is created:

Route::get('map', function() {

    SitemapGenerator::create('http://127.0.0.1:8000')->writeToFile('sitemap.xml');
    return "sitemap generated";
    
});

So, I decided to add them via the manual option:

Route::get('sitemap', function () {
    SitemapGenerator::create('http://127.0.0.1:8000')->getSitemap()
    ->add(Url::create('/')->setPriority(0.5))
    ->add(Url::create('/admin/{locale}/post/{post}')->setPriority(0.5))
    ->add(Url::create('/languages')->setPriority(0.5))
    ->writeToFile('sitemap.xml');
    return "Sitemap Generated";
});

and the sitemap looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <url>
        <loc>http://127.0.0.1:8000</loc>
        <lastmod>2020-01-13T16:01:24+00:00</lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5</priority>
    </url>
    <url>
        <loc>http://127.0.0.1:8000/{language}/post/{post}</loc>
        <lastmod>2020-01-13T16:01:24+00:00</lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5</priority>
    </url>
    <url>
        <loc>http://127.0.0.1:8000/languages</loc>
        <lastmod>2020-01-13T16:01:24+00:00</lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5</priority>
    </url>
</urlset>

Question 1: any reason why the sitemap did not generate with the first code?

Question 2: How does it really work for URL with parameters? I might have multiple posts from in the database, so ideally there should be a url generated for each post.

Jan
07
4 months ago
Activity icon

Started a new Conversation How Do I Print An Inventory List Using Many To Many Relationships

I have a student and task table, and model. Created a pivot table called student_task and here is how i set up the relationship:

class Task extends Model {
    public function students() {
        return $this->belongsToMany(Student::class);
    } .  
}

class Student extends Model{
    public function tasks() {
        return $this->belongsToMany(Task::class);
    }
}

How can I print a list of all students and associated task? In a way, I would want to see the student and task name.

I tried this:

Route::get('student-tasks', function() {
    $students = Student::all();
    foreach($students->tasks as $task) {
        echo $task->name;
    }
});

When I hit the url, I get the following error:

Property [tasks] does not exist on this collection instance.

How can I print a list of all students and associated task?

Note: if I try the code below, I get a list of tasks associated to the user.

$student = Student::first();

return $student->tasks;
Dec
06
5 months ago
Activity icon

Commented on Filtering Aggregated Data

I feel you :)

Nov
27
5 months ago
Activity icon

Replied to Filter Through Array Of Objects Not Working

oops. So I guess I wouldn't have encountered this issue if I tried the code directly on my project since I use webpack to compile. Appreciate the support and definitely agree about the googling on es6-es7 for better knowledge instead of just using things :)

Activity icon

Replied to Filter Through Array Of Objects Not Working

The answer is correct. but why is it that my "this" had no access to the property?

Activity icon

Replied to Filter Through Array Of Objects Not Working

The intention is to have a filtered array yet, but if I type paste "fweffef" which does not match any condition, it still shows an array of 4 objects.

I created a fiddle for it:

https://jsfiddle.net/Wosley_Alarico/n0qgzkbo/66/

Activity icon

Started a new Conversation Filter Through Array Of Objects Not Working

I have an input field in my template that looks like this:

    <input type="text" v-model="search" @keydown="inputChanged" />

Inside my data object I have a list of users:

users: [
  { id: 1, text: "Learn JavaScript", done: false },
  { id: 2, text: "Learn", done: false },
  { id: 3, text: "Play around in JSFiddle", done: true },
  { id: 4, text: "Build something awesome", done: true }
],

How can I return objects based on what the words that a user types when searching for user through text?

My inputChanged method looks like this:

 inputChanged(){
  var filtered = this.users.filter(function (user) {
    return user.text.match(this.search)
  });

If I console log the filtered variable and type any letter, it logs the users' array, which is incorrect.

Activity icon

Replied to Laravel 6 From Scratch, Installation Issues.

My advice, uninstall everything you've installed and check this tutorial from Jeffrey. I personally set up local environments several times and noticed that after installing brew, zsh and php, it automatically switches to the latest version.

https://laracasts.com/series/setup-a-mac-dev-machine-from-scratch