aurawindsurfing

aurawindsurfing

Member Since 2 Years Ago

Dublin, Ireland

Laravel Newbie at @

Experience Points 155,570
Experience Level 32

4,430 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 902
Lessons
Completed
Best Reply Awards 87
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.

15 Jul
16 hours ago

aurawindsurfing left a reply on SSL Issue On Fresh Laravel Install

Maybe just disable it for local developement?

aurawindsurfing left a reply on Testing Registration

Hi @wyatt44

'email' => '[email protected]' is a valid email address.

That is why it fails. Try to pass an empty email.

14 Jul
1 day ago

aurawindsurfing left a reply on Rendering Blade Syntax In A Vue Component

Hi @psychosocial227

Long story short you can not do that.

What you can do however is give your Vue Component a html template and populate some data within Vuejs Component with props.

Something like that:

Your Vue Component:

<template>
    <h4>{{fullname}}</h4>
    <h6>{{title}}</h6>   
</template>

<script>

    export default {
        
        props: {
            fullname: String,
            title: String,
        },
      
    }

</script>

Your blade:

<component_name
    fullname="@lang($user->fullname)"
    title="{{ $user->title }}"
></component_name>

aurawindsurfing left a reply on Relation Has - Through

@98mason no it only goes one level.

Or in onther words there is only one Through

Hope it helps!

aurawindsurfing left a reply on I'm New Here.. Prod VS Dev ENVs (Virtualisation, Containers, Valet?)

Well yes, I heard that people dive full in with docker and of course it all depends on the type of application you will write and maintain. If you plan to use them in production then obviously it will make a lot of sense to have them in development as well.

It all depends at the end of the day.

aurawindsurfing left a reply on I'm New Here.. Prod VS Dev ENVs (Virtualisation, Containers, Valet?)

Hey @jondilworth

If you are on Mac then by all means go with valet. Simple and really amazingly good at what it should be doing.

If you want something more then yes there is Homestead which is a Vagrant image.

Now if you are on Windows then also Vagrant with bit more problems is way to go.

As for docker I personally think is is overrated and just brings unnecessary complications to the mix.

Happy coding!

aurawindsurfing left a reply on SSL Issue On Fresh Laravel Install

Hey @dguerithault thanks to your question I just learned that postgres supports SSL :-)

Have a look here: https://stackoverflow.com/questions/25272838/laravel-with-postgresql-in-sslmode

aurawindsurfing left a reply on Vagrant Xdebug And PHPStorm

Hey @mostafalaravel

If you are after simple debugging of your app try this: https://github.com/barryvdh/laravel-debugbar

Works perfectly with Laravel. I personally gave up on Xdebug. Too much time configuring things, too little coding.

I know this does not answer your question, but I found it the easiest solution and quite nice to use.

Have great weekend coding!

aurawindsurfing left a reply on Multiple Server Workers For A Queue

@crash I had the same approach with my first serious app. Separate database server, balancer, separate workers, trustedproxy (when it was not part of laravel installation) etc.

Then I realised that this is bit over the top and that PHP7 + one worker within the main app was able to handle all the load I had thrown on them. I kept database separate just to be safe but all the rest works much better then expected.

Maybe try to scale up later instead of scaling up at the start.

Just a thought.

13 Jul
2 days ago

aurawindsurfing left a reply on Error In Migration

@digiproduct yes it will wipe out all your data so you SHOULD try to do it on another database.

aurawindsurfing left a reply on Multiple Server Workers For A Queue

Hi @crash

This will be good start: https://laracasts.com/series/queue-it-up

When you say worker server, do you mean queue worker or just a server behind a balancer? There is no need to have muptiple servers to process queues. If you have multiple servers behind load balancer then yes, you star a worker on each one of them. But if you store jobs on your main server then you should be able to process them on main server only.

Hope it helps!

aurawindsurfing left a reply on Storing Report Subscription Schedules

Hi @mprythero

If you think about scheduler it is solving exactly the same problem you have. The way scheduler works is that there is actually a cron command fired every minute that in turns fires your scheduler schedule which in turn can have many scheduled commands. I hope it makes sense.

So what if you use the same approach? Fire one command lets say every hour. And make this command go through your database scheduled reports and fire only those that are due in given day / hour / week? Just put them on queues so your command does not take too long to be processed and you should be ?

Hope this makes sense.

aurawindsurfing left a reply on Error In Migration

@digiproduct Maybe a stupid question but did you try php artisan migrate:fresh I'm not sure if you can apply this after you created a given table?

aurawindsurfing left a reply on Error In Migration

@digiproduct There should not be anything appearing in the structure of the table. The should be a reference appearing in the database schema. Nothing to do with columns in your database. depending on your IDE you might see change at the top of the column.

aurawindsurfing left a reply on Error In Migration

@digiproduct I suppose the only visible difference should be in your database schema when you inspect it.

aurawindsurfing left a reply on The PHP Practitioner - EP 16

@atomzwieback do not stress yourself too much about it. There will be people telling you to learn basics of this and that before you touch it. But honestly Laravel is such a nice framework to work with that you will be flying in no time. You can always get back to the older stuff later.

aurawindsurfing left a reply on The PHP Practitioner - EP 16

Hi @atomzwieback

Yes you are looking at very old course. The routing these days is done in laravel in routes/web.php file.

Have a look at the latest course here: https://laracasts.com/series/laravel-from-scratch-2018/episodes/3

Hope this will help. Also remember that sometimes PHPStorm will sometimes show you false positives if you do not have proper plugins installed.

Good luck!

aurawindsurfing left a reply on Laravel Brower Test (Dusk) Error On MacOS (Docker): Failed To Connect On Localhost Port 9515: Connection Refused

I ended up using it after laradock and homestead. Simple and really impressive.

aurawindsurfing left a reply on Lexxyungcarter/laravel-5-messenger : One Thread By User

Hi @cyrilblankaert

I suppose what you could do is store conversations that user already has with other users, then when you give user option to create a new conversation remove ids of users that already have existing conversations with collection diff:

https://laravel.com/docs/5.8/collections

aurawindsurfing left a reply on In The Place Of Question Mark What Comes For Adding Year In All Table As Session Value Laravel

@abdulbazith

The way you save in in database is simply integer with value of 2019 exactly what you see in the value tag here:

 <option value='2019'>2019 - 2020</option>

then the representation like @snapey told you before will be a decration of f ``2019- but this is only for user to know what it is, it does not matter at all for your database.

Another example of it would be when you have selector for colours:

 <option value='1'>red</option>
 <option value='2'>green</option>
 <option value='3'>blue</option>

See what I mean? The same way you shoudl treat your years, keep value on database, show human readable version to your user.

Hope it helps!

aurawindsurfing left a reply on Is There Any Packages For Google Map?

Hey @larastorm

Be careful with google maps. They changed their pricing last year and if you have a high traffic app and hit their API too much this might happen:

Screenshot-2019-07-13-09.39.59.png

It took them 3 months to resolve that issue and unlock my account.

aurawindsurfing left a reply on In The Place Of Question Mark What Comes For Adding Year In All Table As Session Value Laravel

@abdulbazith answer is correct. If you want to store the information in what year you are now in session here is how you would do it:

session(['academic_year' => '2018-2019']);

or better following the convention, only the id of the actual year:

session(['academic_year' => 2]);

then to retrieve it from user session you do:

$academic_year = session('academic_year');

More about it here: https://laravel.com/docs/master/session#using-the-session

12 Jul
3 days ago

aurawindsurfing left a reply on Return Full Image Url In API Resource

@elo I mean that in your code / logic you build up your url but you keep unique part let's say its ID in the database table called images

aurawindsurfing left a reply on Maatwebsite 3.1 On Importing Queue Failes

Hi @millzbillz

The error is pretty self-explanatory to me:

File "/tmp/laravel-excel 4noteGu1gFjJoFClKJQsLw8SgDShm1nd.xlsx" does not exist.

aurawindsurfing left a reply on Laravel Brower Test (Dusk) Error On MacOS (Docker): Failed To Connect On Localhost Port 9515: Connection Refused

Hey @cyberduck

This I did try to follow the solution but I found out sudo apt is not available for MacOS clearly shows that you try to run your commands in wrong place. If you have docker then this is where your application lives, this is where you run your php artisan commands and etc.

Brew is for MacOS, your are not on MacOS, you are on docker which is linux and has apt get I'm sure you know how to log in into your docker machine and run php artisan commands in there. This is the right place.

Hope it helps!

aurawindsurfing left a reply on Return Full Image Url In API Resource

Hi @elo

I suppose there is nothing wrong with it http://localhost:8000/api/v1/public/images/products/

Until you realise that you want to move to a production server and all your images are locked to your local machine. What you should do is to keep the id part of the path in database and let your code build up the correct url to the resource. You might later store your images on let's say S3 or Cloudinary and then this will become a problem.

Hope it helps!

aurawindsurfing left a reply on Get A Value From Another Controller

Hi @yacira

In your routes file you should have a route for that public function create($id) method, and you should pass $id as an argument within your your route so your controller gets what it expects to get.

However it makes no sense to do public function create($id) since it is to create something. Since you are creating it, there is no way you know its $id. Just remove it.

public function create()

Hope it helps!

aurawindsurfing left a reply on Vue Modal Form @submit.prevent Not Working

Could be also simple missing closing tag somewhere.

aurawindsurfing left a reply on Elasticsearch - Good Tutorial

I also try to figure out why would I use it over Algolia SaaS tbh.

aurawindsurfing left a reply on Send Sms Free From Laravel Application

Hi @mwdeveloper,

And yes @martinbean it exists to some extend. Ill describe it below and just as a disclaimer it allows me to send some 10k text per month per SIM card, depending on your mobile operator tariffs, in my case my operator allows up to 10k text per month for 20e per month ;-)

They way it works is to figure out a 3g dongle that they sell that will work with Gammu linux instance, then you need to unlock this dongle so the network will see it as a phone and not as a modem. Then to use it with laravel you need to use this package: https://github.com/laravel-notification-channels/gammu

Obviously it is pretty hard to set up but in my case works like a charm for last 5+ years by now.

Good luck!

aurawindsurfing left a reply on Can't Import Slug To Database When Attribute Have Special Characters

Hi @untymage

Your are not allowed to use some of thos htmlspecialchars in your title since when presented in an url it will break your code. Besides will you really have those in your titles? There is a good reason for not allowing users to put those in your data. Read this: https://www.w3schools.com/php/php_form_validation.asp

Hope it helps!

11 Jul
4 days ago

aurawindsurfing started a new conversation Elasticsearch - Good Tutorial

Hi,

Can anyone recommend something worth looking at?

Thanks!

aurawindsurfing left a reply on How To Get Blade File Path?

Remove partial blade file.

Put logic in 2 original blade files.

No need for partial here I guess.

aurawindsurfing left a reply on How To Get Blade File Path?

And what does the partial blade file do?

aurawindsurfing left a reply on Vue Modal Form @submit.prevent Not Working

Hi @rothrauffconsulting

Try

<input type="submit" class="btn btn-default btn-danger">Delete</input>

aurawindsurfing left a reply on How To Get Blade File Path?

Hi @untymage

Show more of your code, please.

aurawindsurfing left a reply on Htmlspecialchars() Expects Parameter 1 To Be String, Array Given

Hi @chrisgrim

Your object contains 3 arrays and you should pass a string to your component.

That is what your error says.

aurawindsurfing left a reply on Detect PDF Version With PHP

Hi @cronix and thank you all for your answers.

My problem was that I'm using FPDI to annotate pdf files that I receive via webhooks. The problem was that the free version of FPDI did not support pdf's in version higher than 1.4 and some of my files were in the higher versions.

It turns out it is not so easy to detect the version of PDF file with PHP, yes you can parse mime data and hope to find it there but it is a solution from 2011 and somewhat buggy as I could see.

Some other people suggested using the command line tools. Now, this is an acceptable and free solution but in my case, I would have to run one CLI tool to detect version then another CLI tool called ghostscript to downgrade PDF version to 1.4 and then run it via FPDI.

I mentioned that there is a paid version of FPDI, actually it is an additional package that you can purchase, that requires zero code updates, just pull it in from their private repo and magically support for higher versions will be there.

I know that some people see paying for packages as a silly move but I have no problem with that. Paid 100e for it and it works seamlessly with original FPDI. Happy days.

Hope it helps someone!

aurawindsurfing left a reply on In The Place Of Question Mark What Comes For Adding Year In All Table As Session Value Laravel

@abdulbazith in theory there is no problem with it at all until you actually try to do something with it like add, subtract etc. Also in theory sorting will work but sorting strings might produce different outputs then sorting integers. Many things can go wrong.

aurawindsurfing left a reply on Uploaded Image File To S3 Download By An Link

Hi @sadiq79

S3 does not care what extension the file is. You would have to save it along with S3 id in your database and build it up when downloading.

Hope it helps!

aurawindsurfing left a reply on In The Place Of Question Mark What Comes For Adding Year In All Table As Session Value Laravel

Hi @abdulbazith

At first you are asking for trouble here using PHP reserved name class here is list of PHP reserved words: https://www.php.net/manual/en/reserved.keywords.php

Second you are using string to record a year. The way you could do this is have maybe one year field since academic year always have starting date. One you have that it will be easy to display end year, just add one year to it right?

Third, you are correctly creating new instance of your Class (see how confusing it already gets with that name) but you should leverage laravel Eloquent models, relations to create and persist your data. Have a look here: https://laravel.com/docs/5.8/eloquent

Hope it helps!

aurawindsurfing left a reply on Detect PDF Version With PHP

Hi @jlrdw

When I mean PDF I mean FPDI inside my laravel app processing / annotating PDF files I receive via webhook.

I need a way to check version of pdf file Im receiving and if I want to apply a ghostscript and downgrade version of pdf to 1.4 since FPDI works only with up to 1.4

Thanks!

10 Jul
5 days ago

aurawindsurfing left a reply on Detect PDF Version With PHP

@jlrdw im looking for PDF version and not PHP version ?

aurawindsurfing started a new conversation Detect PDF Version With PHP

What is the best way to detect PDF version with PHP? I know there are some external libraries that can be run from the command line but I only need to find out if I need to run ghostscript in the first place.

Thanks!

09 Jul
6 days ago

aurawindsurfing left a reply on Send HTTP Request Through Other Server

Hi @learn-by-flying

Im not much of a network wizz but here are few ideas:

  1. You do not need to be connected to internet at all. If you use IP in your browser your laravel app should respond depending on server configuration (plesk, nginx etc)

  2. Controller does not ask for anything. Your webserver receives webrequests and processes it. If it finds matching route and that route relates to controller then it will be send there. In you controller or even before, in middleware, you can set it up in a way that only certain IP addresses can have access to this route.

  3. Create an API, secure it with token and there should be no difference if you are on VPN or not.

Hope it helps!

aurawindsurfing left a reply on Test Artisan Command Called

Hi @s.spaan

Maybe simply log to file from your artisan command and watch the file from command line?

tail -f yourfile