aurawindsurfing

aurawindsurfing

Laravel Newbie at @

Member Since 3 Years Ago

Dublin, Ireland

Experience Points
188,740
Total
Experience

1,260 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
962
Lessons
Completed
Best Reply Awards
127
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 38
188,740 XP
Feb
19
3 days ago
Activity icon

Replied to What Extensions On VSCode

Hi @dan3460

Here are all of my settings and extensions:

Install this extension first: https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync

Download all of my settings from here: https://gist.github.com/aurawindsurfing/4e1290569244094d6ccd0ea81d9c9177

Hope it helps!

Feb
18
4 days ago
Activity icon

Replied to Cant Deploy Npm Prod With Forge

Hi @smoketm

I assume you know that but did you commit your nnode_modules to your git and pushed it to your server? If so you should ignore them in your git, remove them and run npm install & npm update

This should give you some warnings if there are packages that require a licence.

In general removing node_modules is always a good start.

Hope it helps!

Activity icon

Replied to Auto-update Language Files On Call __()

@sinnbeck would you be more for database vs json storage of translations?

Activity icon

Replied to Auto-update Language Files On Call __()

Hi @jacobson

Something like this should help: https://github.com/stevegrunwell/lost-in-translation#configuration

It would be unwise to autoupdate on every display of every blade file that you have.

Just found them and translate them.

I also started to use poeditor.com for translation of my projects, you can find some nice example here:

https://bigblue-surfcenter.gr/en scroll to very bottom of page and click help translate

This will bring you to the project in poeditor: https://poeditor.com/join/project/oW8TRBFCzH

Now this way people can actually help to translate this site and it is very easy to add another language is you wish.

Hope it helps!

Activity icon

Replied to Format Nova Field Input Before Validation

Should you be creating your slug by hand in first place? Let the model handle it for you while you create/update it.

Activity icon

Replied to Adding Bootstrap Vue + Boostrap 4 To Laravel Non Spa

Is it not that Bootstrap Vue is basically a bootstrap rewritten in Vue? If so then You should not need the Bootstrap 4 at all.

If there is a conflict however you should simply prefix whole bootstrap vue while adding it to your project and then there should be no conflicts.

Feb
17
5 days ago
Activity icon

Replied to How To Access Database Connected Via PHPStorm Tools

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=dev_admin
DB_USERNAME=
DB_PASSWORD=

Your host is 127.0.0.1 Your database name is dev_admin You need user You might need password if you have set it up.

There are tons of tutorials how to set up MySQL database out there, google it.

Feb
15
1 week ago
Activity icon

Replied to Sum Last Page And Prev Page Item Laravel

$query = $this->log_book->whereBetween('id', array(0, 17))->orderBy('leg_date','asc');
$sum = $query->sum('time');
$paginated = $query->paginate(18);

something along those lines should work.

Feb
05
2 weeks ago
Activity icon

Replied to Upload Image And Resize To Digital Ocean Spaces

Hi @maulayyacyber

Have a look at this solution. It works for me much better as it is able to adjust quality to the clients device:

https://laravel-news.com/integrating-cloudinary-to-your-backend-using-a-php-solution.

Hope it helps!

Jan
16
1 month ago
Activity icon

Awarded Best Reply on Vuejs Carousel

I guess she is one of the best persons to ask:

https://css-tricks.com/intro-to-vue-5-animations/

Dec
19
2 months ago
Activity icon

Awarded Best Reply on Proper Way To Run Laravel Queue In Docker

Hey @region23

This solution does not run your Queue Worker in docker. It runs a command from outside of your docker container to run in a docker container called php

I stopped working with docker but the idea will be to run this command from within the container and actually build it with it already set up. Go back to the thread you are referencing and you will see that you answer is voted -3

https://stackoverflow.com/questions/48884802/docker-laravel-queuework

Go for one of the accepted solutions.

Hope it helps!

Dec
10
2 months ago
Activity icon

Replied to Is There A Way To Handle This Race Condition?

Hey @bwrice

This does not make sense:

jobB sets it finalized at column and jobA sees all orders for the group are finalized and dispatches

since finalized_at is only set at the end of the background job there should be no case when jobA sees all orders for the group are finalized when jobA finishes there is still jobB with finalized_at == null therefore it should not have dispatched any notifications.

Another approach would be to simply run a command responsible for dispatching notificatiions every x minutes if some conditions are met.

Hope it helps!

Activity icon

Replied to No Error Reporting, App Hangs In Browser

Ok.

T_DOUBLE_ARROW is the token for =>, so you have one which appears somewhere the parser doesn't expect it.

Google for T_DOUBLE_ARROW and you will find the solution.

If errors still do not show change your App_ENV from production to local this should fix it.

Hope it helps!

Dec
09
2 months ago
Activity icon

Replied to No Error Reporting, App Hangs In Browser

Hey @maparfitt

Have a look at your php.ini maybe you have set up execution time to something crazy and the reason your app does not show any errors is that it is just waiting to time out?

The other thing I would try is to create a simple test route in your web.php routes file and hit that route:

Route::get('/testerror', function () {
    abort(404, "This should show an error page");
});

Hope it helps!

Dec
06
2 months ago
Activity icon

Awarded Best Reply on How To Set Up WordPress With Forge When Using An AWS RDS Database?

Hey @ralphmrivera

Just create an empty site with forge on your server. Then SSH to it and install wordpress:

wget https://wordpress.org/latest.tar.gz
Then unzip the package using:
tar -xzvf latest.tar.gz

https://wordpress.org/support/article/how-to-install-wordpress/

Then change IP od your MySQL server to RDS one.

I still do not understand WHY 😀

Nov
30
2 months ago
Activity icon

Replied to Accessor Is Not Working.

Id me get be reserved somehow. Try doing the same but with different names attribute.

Nov
23
2 months ago
Activity icon

Replied to Laravel Scout Algolia: How To Deal With 1 Model <-> 5 Index

Hey @ramzig

Ideally you should have one model with one corresponding index. Then you can search that index filtering by types, this is how this should work.

Hope it helps!

Nov
21
3 months ago
Activity icon

Replied to Does Envoyer Or Forge Auto-scale?

4 Years ago - No Now we have - Laravel Vapor https://vapor.laravel.com/

And oh boy it does autoscale 😄

Activity icon

Replied to Changing SMTP Details On The Fly

It is probably due to cache of the config or multitenancy and 2 users overwriting each other at the same time.

Try to clear cache in the same command. If this does not help.

Other then that I would try to create a separate instance of the Mailer class for each user or try to use API like mailgun and set up your counter domains there at first. Then only rotate API keys.

Hope this helps!

Nov
20
3 months ago
Activity icon

Replied to Laravel Test "remembers" Api_token Authentication For Unauthenticated Followup Request

Hey @davewood

Try using this trait as well:

namespace Tests\Unit;
    
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
use App\User;

use Illuminate\Foundation\Testing\WithoutMiddleware;

It will disable all session data.

Hope it helps!

Activity icon

Replied to Difference Between Two Dates In Laravel

Hey @vkot91

If they are both instances of Carbonthen you can simply compare them like this:

$difference = $startDate->diffInDays($endDate);

Hope it helps!

Activity icon

Replied to Changing Logout Redirect Path In Laravel Nova

@elo

Change:

APP_URL=http://localhost

to

APP_URL=http://yourapplicationname.test

and then see how the logout will work, your nova url will be:

http://yourapplicationname.test/nova

Hope it helps!

Nov
19
3 months ago
Activity icon

Replied to How Can I Connect Laravel With Ms Access ?

Hey @arsalan34

Hope this points you in the right direction:

Create link in MS Access with your MySql database table and now both databases have same data every time.

Procedure for link MySql table in MS Access database. https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-examples-tools-with-access-linked-tables.html

Activity icon

Replied to Getting The Width And Height From Upload Value

Try:

img.onload = function () {console.log(this.width)}

Hope it helps!

Activity icon

Replied to How To Set Up WordPress With Forge When Using An AWS RDS Database?

Hey @ralphmrivera

Just create an empty site with forge on your server. Then SSH to it and install wordpress:

wget https://wordpress.org/latest.tar.gz
Then unzip the package using:
tar -xzvf latest.tar.gz

https://wordpress.org/support/article/how-to-install-wordpress/

Then change IP od your MySQL server to RDS one.

I still do not understand WHY 😀

Activity icon

Replied to Add Unique License To APP

Ioncube will be probably the only option.

But to be honest look at how whole Laravel ecosystem works. The private repo seems to be the most popular way. Maybe you are overthinking it a bit?

On the other hand you could also build your app in a way that client needs internet connection to authorise with some sort of your API.

Nov
18
3 months ago
Activity icon

Replied to Changing Logout Redirect Path In Laravel Nova

Hey @elo

I'm pretty sure Nova has nothing to do with your Passport check the basic .env file in your app. Did you change:

APP_URL=http://localhost

to the name of your app?

Activity icon

Replied to Add Unique License To APP

Hey @kboat14

You can sell subscription and deactivate user account when it expires.

If you give your code to clients then you can distribute your app as a private repository, just like Laravel Nova.

There is also thing called https://www.ioncube.com/loaders.php it allows you to encrypt some of the files in your php application. I have seen some people using it.

To be honest private repo is probably the easiest.

Hope it helps!

Activity icon

Replied to Eloquent Load Only Related Deep Relation

Hi @constantinff

Try to reverse your query.

What you try to do at the end of the day is to get subscriptions that have users that in turn have groups.

This might be used https://laravel.com/docs/master/eloquent-relationships#has-one-through or if there are keys on those tables simple BelongsTo should do the trick.

Nov
17
3 months ago
Activity icon

Replied to Best Practice To Avoid Three Almos Identical Controllers?

No it does not. It has methods that you use like normal. While you extend it you have access to it's methods.

Have a look here: https://stackoverflow.com/questions/5199862/php-class-inheritance-for-beginners

Hope this helps!

Nov
16
3 months ago
Activity icon

Replied to Merging Request Params With Array

Hi @gabotronix

Fro your code:

 public function filters()
    {
        //returns associative array of request body key value pairs
        return $this->request->all();
    }

Return an array and then you try to use collection merge method on it:

$filters->merge($toMerge);

This is not a collection, this is an array, try:

$result = array_merge($filters, $toMerge)

Hope it helps!

Nov
13
3 months ago
Activity icon

Replied to Convert Objects Of Arrays In Laravel

$prepared_products = $order->productwarehouses()->with('product')->get()->groupBy('product.id')->toArray();

toArray also converts all of the collection's nested objects that are an instance of Arrayable to an array. If you want to get the raw underlying array, use the all method instead.

Activity icon

Replied to Best Practice To Avoid Three Almos Identical Controllers?

Hey @rafaelmunoznl

Yes you can create lets say XController in that controller try to divide the show function into smaller functions.

The in your CompaniesController use extend like this:

class CompaniesController extends XController {

}

Now what that will allow you to do is to use all of the original methods of XController and if one needs to be changed then you just redeclare it again.

This will simplify your code a lot.

Hope it helps!

Activity icon

Replied to Laravel File_put_contents(..../session/....) Failed To Open Stream

Hey @seventopo

Save yourself some time and get a proper hosting that will let you understand your errors while accessing the console.

This issue is probably related to permissions and some folders not being set up properly.

Long story short. Click on one of the ads from Digital Ocean here is a my referral link that will give you 50e https://m.do.co/c/27a7fce72833

Then register also Laravel Forge to easily provision (install) your servers with MySQL, PHP, Nginx etc.

Then sib back and relax ;-)

Activity icon

Replied to Googlebot Cannot Access Images Hosted On CloudFront - Reports Blocked By Robots.txt

Hey @thebigk

I would look then at AWS policies, maybe bots are excluded in there from accessing the files and you can only access it from your application?

Hope it helps!

Nov
10
3 months ago
Activity icon

Replied to Googlebot Cannot Access Images Hosted On CloudFront - Reports Blocked By Robots.txt

Hey @thebigk

This might be long shot but is there a way to sitemap your images and give it to google that way?

Here is some info I found: https://support.google.com/webmasters/answer/178636?hl=en

Activity icon

Replied to Make An Appointment System

@hafizurupm it is the right place to learn how to make such a system for sure.

Start from https://laracasts.com/series/laravel-6-from-scratch

This will give you a good idea where you should start.

Nov
09
3 months ago
Activity icon

Replied to Comparing Services For Cheap Cloud Hosting And Storage (Cloud / AWS / S3 / Amazon Cloudfront / ... ???)

Hey @connecteev

AWS <> as close to free as possible
as fast as possible <> as close to free as possible

If you want something free and really well thought then go and try https://www.netlify.com/ this might serve your goal with few tweaks.

Hope it helps!

Nov
07
3 months ago
Activity icon

Replied to Remote Model

Hey @poxin

Trucker looks more like for mapping resources. What you need it to possibly Cache your responses from API to have some sort of safety on your side when API will be down. This way you will have old data to work with or by setting expiry on Cache you will actually limit your API queries.

Just an idea.

Hope it helps!

Activity icon

Replied to Dealing With Git - Main Package And Subpackages

Why not do simple bash script for your project?

https://laravel-news.com/bash-aliases

Have it chained in one command and commit all of them at once, maybe even detect if there was a change and and only then commit that submodule?

Hope it helps!

Nov
04
3 months ago
Activity icon

Awarded Best Reply on Oci8 Exception - Laravel On Centos 7

Hi @konrms

I have a similar setup working. Some points from my notes that might help you troubleshoot.

Did you add

extension=oci8.so

to your php-fpm.ini?

check if it is installed:

php -m | grep oci

or

<?php phpinfo(); ?>
i
print_r(get_loaded_extensions());

test connection from your app:

$conn = oci_connect("USER", "passwprd", "localhost/xe");
 echo $conn;

Only here install yajra

Hope it helps!

Nov
02
3 months ago
Activity icon

Replied to Proper Way To Run Laravel Queue In Docker

Hey @region23

This solution does not run your Queue Worker in docker. It runs a command from outside of your docker container to run in a docker container called php

I stopped working with docker but the idea will be to run this command from within the container and actually build it with it already set up. Go back to the thread you are referencing and you will see that you answer is voted -3

https://stackoverflow.com/questions/48884802/docker-laravel-queuework

Go for one of the accepted solutions.

Hope it helps!

Activity icon

Replied to Oci8 Exception - Laravel On Centos 7

No worries! Oracle Magic!

Activity icon

Replied to Oci8 Exception - Laravel On Centos 7

Hi @konrms

I have a similar setup working. Some points from my notes that might help you troubleshoot.

Did you add

extension=oci8.so

to your php-fpm.ini?

check if it is installed:

php -m | grep oci

or

<?php phpinfo(); ?>
i
print_r(get_loaded_extensions());

test connection from your app:

$conn = oci_connect("USER", "passwprd", "localhost/xe");
 echo $conn;

Only here install yajra

Hope it helps!

Activity icon

Replied to How To Make Laravel Load Very Fast

Is this a question or a statement? 😃

Activity icon

Awarded Best Reply on Limit The User Login To Specific Time Period

@itxrahulsingh read the docs carefully.

The way this works is that request to your app will hit every middleware each time you ask for anything. This is how login of users works. Here, for example, you have default middleware that is already in use in your app:

protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            // \Illuminate\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

        'api' => [
            'throttle:60,1',
            'bindings',
        ],
    ];

So before anything happends in your app it already check for:

  • cookies
  • sessions
  • authenticated sesssions
  • errors in session
  • csrf token

So it already checks if user is logged in. You only need to add another one that will let users log in only within working hours.

It will always work for every request to your app.

Hope it helps!

Activity icon

Replied to How To Query Database For Each Day In An Array Of Days Laravel

Hey @farshadf

Modify it to your needs but something like that will do the trick:

$room_capacity = Capacity::query()
            ->whereBetween('date', [
                Carbon::now()->startOfMonth()->subMonth()->toDateString(),
                Carbon::now()->startOfMonth()->subMonth()->endOfMonth()->toDateString(),
            ])
            ->get();

This here makes no sense:

->whereDate('from_date', '<=', $dates[$t])

It actually should be:

->where('date', '<=', $dates[$t])

Also if you try to do a booking system then try to think in a smallest possible interval when you think about your reservations. For instance if room can only be booked for 1 day, then instead of creating from_date to_date you could create 31 days in a given month and then create lets say 4 consecutive bookings for one day for that room - meaning it would be booked for 4 days.

This type of approach will make your system more flexible and easier to work with.

You can even go down to hours and book rooms per hours. Even go down to minutes etc etc. Your future queries would be much simpler then as well.

Hope it helps!

Activity icon

Replied to Limit The User Login To Specific Time Period

@itxrahulsingh read the docs carefully.

The way this works is that request to your app will hit every middleware each time you ask for anything. This is how login of users works. Here, for example, you have default middleware that is already in use in your app:

protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            // \Illuminate\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

        'api' => [
            'throttle:60,1',
            'bindings',
        ],
    ];

So before anything happends in your app it already check for:

  • cookies
  • sessions
  • authenticated sesssions
  • errors in session
  • csrf token

So it already checks if user is logged in. You only need to add another one that will let users log in only within working hours.

It will always work for every request to your app.

Hope it helps!

Activity icon

Awarded Best Reply on Laravel Delete Relationships On A Single Model?

Hi @zyxxyzyxz

Have a look here: https://laravel.com/docs/master/eloquent-relationships#updating-belongs-to-relationships

There are quite a few that you could use like

$user->account()->associate($account);
$user->account()->dissociate();

$user->save();

There is also one for pivots

// Detach a single role from the user...
$user->roles()->detach($roleId);

// Detach all roles from the user...
$user->roles()->detach();

Hope it helps!