aurawindsurfing

aurawindsurfing

Laravel Newbie at @

Member Since 2 Years Ago

Dublin, Ireland

Experience Points
181,690
Total
Experience

3,310 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
959
Lessons
Completed
Best Reply Awards
117
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 37
181,690 XP
12 Sep
1 week ago

aurawindsurfing left a reply on Dashboard View: Using Filters On Collection

Hey @wva

Why not simply do in blade:

$team->upcomingEvents()->oldest()

Or whatever way you decide which one is coming up next.

aurawindsurfing left a reply on How To Change The Button Into Badge, If It Is Already Approved?

What are you using to do this? You would typically do this with javascript so when some property changes the badge appears.

aurawindsurfing left a reply on Deploying Laravel Project On GoDaddy Server

Do you have access to the console of that server?

You should run:

php artisan key:generate

Hope it helps!

10 Sep
1 week ago

aurawindsurfing left a reply on Laravel Messenger Package

Here is a simple 1-1 messaging package if anyone is looking for this: https://github.com/aurawindsurfing/messenger

04 Sep
2 weeks ago

aurawindsurfing left a reply on Setup A Shop.stechmax.com

Hey @successdav

Just think about it as a complete separate website that happen to have address shop.stechmax.com

From here it is just any ecommerce solution that you are looking after, wheater it will be laravel, shopify or anything else.

There is hundreads of materials how to to set up ecommerce out there.

03 Sep
2 weeks ago

aurawindsurfing left a reply on Migrations Are No Longer Autoloaded Since Laravel 5.5?

Hey @bobbybouwmann

I'm building my first package and was wondering why:

if (!class_exists(CreateSomeTable))

did not detect the migration files, which in turn caused duplicate migration files while publishing which in turn caused the whole thing to crash ;-)

I changed the way I cjeck it in my ServiceProvider to:

if (empty(glob(database_path('migrations/*_create_messages_table.php'))))
            {
                $this->publishes([
                    __DIR__ . '/../database/migrations/0000_00_00_000000_create_messages_table.php' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_messages_table.php'),
                ], 'migrations');
            }

and now it is working as expected.

I was wondering however if there was any particular reason for them being excluded, other then making no sense to import them 😀

aurawindsurfing started a new conversation Migrations Are No Longer Autoloaded Since Laravel 5.5?

Hey Guys!

Just wonder if anyone can share with me why up until 5.4 everything in database folder was autoloaded:

"autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\": "app/"
        }
    },

but since 5.5 it is only factories and seeds that are autoloaded.

"autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\": "app/"
        }
    },

Could not find the pull request on github for this.

Thanks!

29 Aug
3 weeks ago

aurawindsurfing left a reply on Undefined Var In Vue.js

In console it should give you the line. If not then it is the first place you try to use this variable.

27 Aug
3 weeks ago

aurawindsurfing left a reply on Add New Comment Syntax For Blade: ';;' ?

Hey @miwal

I just wonder, why would you write comments in your blade files at all? If you find yourself writing comments then your code is not clear to understand IMHO. Not that Laravel Core does not have lots of comments 😀

aurawindsurfing left a reply on How Many Controllers For The Same Thing?

Hey @barley

Did you see this video? It might answer some of your questions:

Cruddy by Design

aurawindsurfing left a reply on Laravel ID Authentication With Users From Multiple Tables

Hey @dennys

Two problems here:

You should login only your users. Think about it. Every Trainer Formatore is a user. So just login users.

Second change the default field for user like in the documentation: https://laravel.com/docs/master/authentication#included-authenticating

Username Customization By default, Laravel uses the email field for authentication. If you would like to customize this, you may define a username method on your LoginController:

public function username()
{
    return 'username';
}

Hope it helps!

aurawindsurfing started a new conversation Better Model Relationship

Hi Guys. I need some help with making my relationship query better. I have 4 columns like so:

users
user_id

vendors
id
user_id

jobs
id
user_id

offers
id
vendor_id

This is the query I came up with to display Vendor Jobs via offers that he placed. So user owns the jobs and vendors can place offers on them. Here is the query:

public function closedJobs()
    {
        return Job::whereState('closed')->with(['offers' => function ($offers) {
            $offers->whereVendorId($this->id);
        }]);
    }

Any way to handle it better? I did not want to install any third party packages like hasManyThroughDeep I want to use plain laravel eloquent only no RAW queries.

Thanks!

aurawindsurfing left a reply on Quill Editor Integration With Laravel 5.8

Sorry - edited my answer:

Do:

npm install quill

in terminal while being inside you application folder.

Edit /resources/js.app.js after

window.Vue = require('vue');

add

import Quill from 'quill';

Vue.use(Quill);

In your webpack.mix.js

Make sure it is part of the mix:

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css');

run npm run dev

Now it should be available to you.

aurawindsurfing left a reply on Default Forge Server Name Affecting Emails Going To Spambox?

Hey @gdarends

This looks clearly like misconfiguration of wordpress. Forge should have nothing to do with it. The question is how wordpress is sending those emails and where that is meant to be configured.

aurawindsurfing left a reply on Quill Editor Integration With Laravel 5.8

Hey @sumanb

As per official documentation paste this in your blade file:


<!-- Include Quill stylesheet -->
<link href="https://cdn.quilljs.com/1.0.0/quill.snow.css" rel="stylesheet">

<!-- Create the toolbar container -->
<div id="toolbar">
  <button class="ql-bold">Bold</button>
  <button class="ql-italic">Italic</button>
</div>

<!-- Create the editor container -->
<div id="editor">
  <p>Hello World!</p>
</div>

<!-- Include the Quill library -->
<script src="https://cdn.quilljs.com/1.0.0/quill.js"></script>

<!-- Initialize Quill editor -->
<script>
  var editor = new Quill('#editor', {
    modules: { toolbar: '#toolbar' },
    theme: 'snow'
  });
</script>

https://github.com/quilljs/quill

Hope this helps!

aurawindsurfing left a reply on Diff In Days On Eloquent

Hey @pickab00

Mysql has function DATEDIFF()

Hope this will help!

24 Aug
4 weeks ago

aurawindsurfing left a reply on Pagination Problem - Probably I'm Just Dumb

I have absolutely no idea whatsoever. Still

probably I'm just dumb

makes me feel better as I feel like this every day 😎

23 Aug
4 weeks ago

aurawindsurfing left a reply on HasMany(Child) And Return $this->where() In Child Model Doesn't Work

Hi @romainb

Your example


class Comment extends Model
{
    public function accepted()
    {
        return $this->where('accepted', 1);
    }
}

will not work since you are buiding up a query here. This reffer here to this particular instance of your model so unless it has accepted = 1 it will not work. YOu need to search all of you models like so:

 class Comment extends Model
{
    public function accepted()
    {
        return Comment::where('accepted', 1)
    }
}

Hope this helps!

aurawindsurfing left a reply on LARAVEL Price Comparison

@morganchorlton3 schedule a job to run at regular intervals and store data in your database.

aurawindsurfing left a reply on Affiliate Tracking Software For Laravel

Meaning what exactly? Any examples?

aurawindsurfing left a reply on Forge SSH & Public Keys Where Is These Stored

Hey @eddieace

It simply runs


mkdir -p ~/.ssh && your_public_key.pub >> ~/.ssh/authorized_keys

22 Aug
1 month ago

aurawindsurfing left a reply on Laravel Pusher Chat Application

Whats happening on line?:

PusherBroadcaster.php", "line": 119

aurawindsurfing left a reply on UNABLE TO BOOT UP VAGRANT

Hey @successdav

Remove vitrualbox.

Remove vagrant.

Reinstall everything 😀

21 Aug
1 month ago

aurawindsurfing left a reply on ID Of Model Created With Model Factory.

Hey @phpmick

On the same boat now 😀

You probably already seen: https://laracasts.com/series/build-a-laravel-app-with-tdd/episodes/1

and I was also told this is one of by far the best resources: https://course.testdrivenlaravel.com/

Hope it helps!

20 Aug
1 month ago

aurawindsurfing left a reply on ERR_CONNECTION_RESET

Hey @deepu07

Check your S3 bucket permissions. You could possibly have some rule in place that allows only certain regions to access it.

Hope it helps!

aurawindsurfing left a reply on Cannot Update Nova To Later Release Via Composer - INVALID CREDENTIALS Error

Hey @xongooli

I will not be much help here, but I checked my composer.json and auth.json and I have exactly the same settings. Maybe you changed your password and did not update it, maybe remove nova from your project and install it again.

If this does not help then twitter guys at laravel for assistance. It is paid licence after all.

Hope it helps!

aurawindsurfing left a reply on Does Laravel Not Have Singleton Routes?

Create a route:

Route::get('/account', '[email protected]')->name('account');

In your UserController

 public function account()
    {
        $user = Auth::user();
        
        return view('account', compact('user'));
    }

You do not neer route parameter to do that.

aurawindsurfing left a reply on Getting Forbidden Access While Creating Symlink.

Looks like your host does not allow it.

  1. Write up to them.

  2. Get yourself better hosting like Digital Ocean + Laravel Forge.

Hope it helps!

aurawindsurfing left a reply on Laravel Customize Default Forgot Password To Allow User To Search Account By Username Or Email Address

Hey @dunzo

It seems like bad idea to allow unregistered users or bots to search your usernames + email.

Do you want to give me all your email addresses for free?

Think about it.

17 Aug
1 month ago

aurawindsurfing left a reply on Nested Route Not Found

Hey @ftiersch

In artisan route:list look above the one that you listed and see if there is one that matches or catches it. Maybe there is one like this:

pinwald/some-words/spot/some-otherstuff/bearbeiten
16 Aug
1 month ago

aurawindsurfing left a reply on What's The Best Place To Add This Code?

Yes you could do that is aSubscription is a thing. If not then only Users have subscriptions then you can put it directly on User model.

aurawindsurfing left a reply on What's The Best Place To Add This Code?

Hey @appyapp

If renewalPeriodStart and renewalPeriodEnd reffer to your subscription then create Subscription Model and put them there.

Later you will be able to call:

$user->subscription->periodEnd();

From your code.

15 Aug
1 month ago

aurawindsurfing left a reply on How To Keep Track Of Available Variables In A PHP File When You Have Several 'require's?

Hey @cesarmd

Being new to PHP myself I found this question quite interesting and here is what I found:

The require() function is identical to include(), except that it handles errors differently. If an error occurs, the include() function generates a warning, but the script will continue execution. The require() generates a fatal error, and the script will stop.

Have a look here: https://stackoverflow.com/questions/2418473/difference-between-require-include-require-once-and-include-once

14 Aug
1 month ago

aurawindsurfing left a reply on How "smart" Should Model Methods Be?

Hey @natepisarski

In my opinion problem is in your architecture that youy try to solve with your model methods.

Put both users and administrators on the same table. What is the difference between user and administrator? The only difference would be one column on users` table calledroleoris_admin`` or something similar.

In other words, every administrator is a user. Not every user is an administrator

Hope this helps!

aurawindsurfing left a reply on Problems With Installing Valet

Hey @mbo

Looking at your brew list I see no composer installed there. Maybe try installing it first via brew and uninstalling the one you are using right now. Then try composer global require laravel/valet again.

aurawindsurfing left a reply on How To Persist Data Using 3 Different Models In The Same Store Method Of Single Controller..

hey @left

Just a quick improvement would be to skip all values that you just copy from request and replace them with $request->all() then add all the exceptions you have for each of the fields. SOmething like that:

  $device = Device::create([array_merge(
  $request->all(),
  'second_imei' => isset($validated['second_imei']) ? $validated['second_imei'] : null,
  'accessories' => json_encode($validated['accessories'], JSON_UNESCAPED_UNICODE),
  )]);
13 Aug
1 month ago

aurawindsurfing left a reply on Working With Dates And DB

Hey @cyjobes

Reading this reminded me about this:

wisdom-of-the-ancients

You are not alone 😀

But on a serious note. I honestly think that keeping both of them makes no sense at all. I would keep just start_date_ts as timestamp, rename it to start_date for readability and this is all you need.

From there you can simply calculate your times, add, subtract etc and only then you need to display it you turn it into human-readable format. Other then that you just work with timestamps.

Hope it helps!

aurawindsurfing left a reply on Doctrine\DBAL\Driver\PDOException

Hey @randy_johnson

Do you actually have mysql installed? What happens when you type this into your console:

mysql -uroot -p

or

mysql -uhomestead -p

aurawindsurfing left a reply on Email Data Not Appearing In View?

Hey @uccdev

You are correct in accuming your $data is null and this @isset($data) is never executed.

Your mail send function seems incorrect:

Mail::send('emails.numbers_found, $data, function($message) { $message->to('[email protected]'); $message->from('[email protected]'); });

I could not find Mail::send facade in my project. What you could do in theory is this:

 Mail::plain('plainText.view', $data, function ($message) {
                $message->from('[email protected]', 'John Doe');
                $message->sender('[email protected]', 'John Doe');
            
                $message->to('[email protected]', 'John Doe');
            
                $message->cc('[email protected]', 'John Doe');
                $message->bcc('[email protected]', 'John Doe');
            
                $message->replyTo('[email protected]', 'John Doe');
            
                $message->subject('Subject');
            
                $message->priority(3);
            
                $message->attach('pathToFile');
            });

But there is better way to handle it to use it you should first create a mailable class like this:

php artisan make:mail OrderShipped

It will then create app/Mail/OrderShipped mailable class withing your project.

Then you can specify what view, what data you want.

Then you send it using:

Mail::to($request->user())
    ->cc($moreUsers)
    ->bcc($evenMoreUsers)
    ->send(new OrderShipped($order));

More about it here: https://laravel.com/docs/master/mail#generating-mailables

Hope it helps!

aurawindsurfing left a reply on New Laracasts For Old?

Which is the old one you have in mind, please?

aurawindsurfing left a reply on Problem With Redirect()->intended() After Login In Laravel 5.8

Then maybe for some reason it fails that validation?

aurawindsurfing left a reply on Index View Isn't Showing

Hey @alphadev

In your

layouts.frontLayout.front_design

You should have also:

@yield('content')

Also double check if naming for those files is correct it should be in:

resources/views/layouts/frontLayout/front_design.blade.php

You index should sit in the main

/resources/views/index.blade.php

Hope it helps!

12 Aug
1 month ago

aurawindsurfing left a reply on Laravel Basics

What are you trying to do?