aurawindsurfing

Laravel Newbie at @

Member Since 4 Years Ago

Dublin, Ireland

Experience Points
230,510
Total
Experience

4,490 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
1153
Lessons
Completed
Best Reply Awards
155
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.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 47
230,510 XP
May
20
3 weeks ago
Activity icon

Replied to Laravel 8 - GuzzleHttp POST Request With Body And Header Params

Hey @tetrapack68

What usually works for me is nailing down your request in https://www.postman.com/ then export the php code to see what headers, body etc was included. It also helps to just see your generated https request in your browser or in laravel ray.

This way you will be able to experiment with body, params and so on.

Here is example of one I'm using:

$response = Http::post(env('PLAID_ENV') . '/transactions/get', [
            'client_id'    => env('PLAID_CLIENT_ID'),
            'secret'       => env('PLAID_SECRET'),
            'access_token' => $this->company->access_token,
            'start_date'   => $start_date,
            'end_date'     => $end_date,
        ]);

        $transactionCount = $response->json()['total_transactions'];

I also think you mistaken ->withBody() with actual body params, I think your request should look more like this:

$response = Http::asForm()->post('http://example.com/users', [
    'pile_sn' => $pile_sn,
     'key' => $pile_key
]);

Nothing else.

Hope it helps!

Activity icon

Replied to Livewire - Back Button

Hey @jhutto

Thats because you tell component to do so each time it is generated for the first time in here:

public function mount()
    {
        
        
        $this->DefaultSemester = Semester::where('semester_default', '=', '1')->get();
        $this->selectSemester['SemesterID'] = $this->DefaultSemester[0]->id;
        

    }

If you do instead something like this:

public function mount()
    {
        
        
        $this->DefaultSemester = session()->has('semester') ? session('semester') : Semester::where('semester_default', '=', '1')->get();
        $this->selectSemester['SemesterID'] = $this->DefaultSemester[0]->id;

    }

and then in your registration set the session it should work.

May
15
4 weeks ago
Activity icon

Replied to My Session Is Not Persisting

Hey @danielhe4rt

Do you see those 2 lines in your env file?

SESSION_DRIVER=file
SESSION_LIFETIME=120

Or you maybe changed it to something else and it simply does not work regardless of your 3rd party auth process?

Apr
20
1 month ago
Activity icon

Replied to DataTable Error On Webpack

@anonymouse703

Remove resources/assets/admin/plugins/DataTables/js/dataTables.bootstrap4.min.js from your mix and see if it compiles.

Import it manually at the top of the blade layout file.

Activity icon

Replied to Laravel Big Logs Problem With Big Projects

@rafy_alahmad

  1. Keep them in the files and then clean the files with https://github.com/spatie/laravel-directory-cleanup

  2. Keep them in a database and then clean the table if it grows too big.

Hope it helps!

Apr
19
1 month ago
Activity icon

Replied to Clean Install Laravel, Jetstream, Inertia Is Giving A Blank Page

Does pure laravel installation actually work? It looks like there is no PHP running.

Activity icon

Replied to Recovering Data From A Webmail Calendar

I would sync everything with google calendar and then use this Spatie package:

https://github.com/spatie/laravel-google-calendar

Activity icon

Replied to Best Code Editor For Laravel?

@marosmjartan VSCode is quite nice and fast, especially when switching between projects.

At the end of the day it is up to your personal preference what do you like more. I was VSCode, then switched to PHPStorm. It takes a lot of tweaking to get any of them to you liking.

Apr
15
1 month ago
Activity icon

Replied to How To Get The Key Based On Values?

As @tykus pointed out you have it nested so you have to "double" the method to get to the nested level.

Activity icon

Replied to How To Get The Key Based On Values?

@romain you can use one of these:

https://laravel.com/docs/master/collections#method-keyby

or

https://laravel.com/docs/master/collections#method-filter

Filter is more "natural" as it iterates over your collection.

Mar
30
2 months ago
Activity icon

Replied to Easiest Way To Make Progress Bar In Livewire

@chaudigv I never said I use it to upload a file. Which I'm not ;-) This does not work in my case.

Activity icon

Replied to Easiest Way To Make Progress Bar In Livewire

@martinbean so emit from livewire loop and update class with js.

Any nice way to do this in alpinejs? I saw it only binds to bool, any way to trigger that width?

Thanks!

Activity icon

Started a new Conversation Easiest Way To Make Progress Bar In Livewire

Hey everyone!

Just playing around with a progress bar in livewire and can not figure out how to refresh this div after public property $width changes on the component:

public $width = 1;
<div>
Processing transactions ...
	<div class="h-3 relative max-w-xl rounded-full overflow-hidden">
		<div class="w-full h-full bg-gray-200 absolute"></div>
		<div class="h-full bg-green-500 absolute w-{{$width}}/4"></div>
	</div>
</div>

The property gets updated in the loop and it is only refreshed after the loop ends.

Thanks!

Mar
25
2 months ago
Activity icon

Awarded Best Reply on Don't Touch!

Hey @arketekt

Yes this is exactly the way you should do this:

php artisan vendor:publish

The overwrite anything you like in resources/views In those views there should be references to the styling files so you might just want to write your own styles and drop the basic ones.

Hope it helps!

Mar
24
2 months ago
Activity icon

Replied to Livewire Modal With Alpine Transitions

@veur I do not have modal as component. I simply add it as part of the main component blade as above.

Please note that there are 2

x-show="show_modal == true"

This is the only way I was able to get it to work. Also I show slider based on session and not component variables.

Activity icon

Replied to Livewire Modal With Alpine Transitions

Hey @veur

Here is how I do it:

@if (session('card-error'))
            <div x-data="{ show_modal: true }" x-show="show_modal == true"
                 class="fixed bottom-0 inset-x-0 px-4 pb-6 sm:inset-0 sm:p-0 sm:flex sm:items-center sm:justify-center">
                <div x-show="show_modal == true"
                     class="fixed inset-0 transition-opacity"
                     x-transition:enter="ease-out duration-300"
                     x-transition:enter-start="opacity-0"
                     x-transition:enter-end="opacity-100"
                     x-transition:leave="ease-in duration-200"
                     x-transition:leave-start="opacity-100"
                     x-transition:leave-end="opacity-0"
                >

so looks like you are missing:

x-show="show_modal == true"
Mar
18
2 months ago
Activity icon

Replied to Reset Password Using OTP

@murtazapervez

Just remember about the safety updates if they are available...

https://blog.laravel.com/laravel-cookie-security-releases

Mar
16
2 months ago
Activity icon

Replied to Reset Password Using OTP

Hey @murtazapervez

I would suggest to upgrade your laravel version to the latest version - it is not that hard to do. Then you cans simply use build in Fortify Two Factor Authentication. They use TOTP but it is really the same thing as OTP it is just that provider of the code is different ;-)

https://laravel.com/docs/master/fortify#two-factor-authentication

It should be easy enough to customise.

Activity icon

Replied to Custom Validation Error Formating

@makos If you are not simply looking for customising your error message then after validation hook should do the job: https://laravel.com/docs/master/validation#after-validation-hook

In it you will be able to add everything you really need.

Mar
15
2 months ago
Activity icon

Awarded Best Reply on Change Connection Right After Login

@johnw65 https://www.php.net/manual/en/oci8.connection.php

I would still however go and use https://github.com/yajra/laravel-oci8 it in active development, if you still have the same issue just rise an issue there, I'm sure you will get appropriate answer.

Activity icon

Awarded Best Reply on Can I Install NOVA On A Different Sub Domain?

@kevdev Yes you are. You pay licence for one production server.

Activity icon

Replied to Can I Install NOVA On A Different Sub Domain?

@kevdev Yes you are. You pay licence for one production server.

Mar
14
3 months ago
Activity icon

Replied to PWA

@meisamtj

I think it will be just simple generation of the whole set of icons. Here are 2 apps I use for generating icon sets for an app:

https://makeappicon.com/ https://realfavicongenerator.net/

More PWA specific will be one described here: https://itnext.io/pwa-splash-screen-and-icon-generator-a74ebb8a130

I wonder however if it it not the same as the makeappicon anyway.

Mar
12
3 months ago
Activity icon

Awarded Best Reply on What Choose Multi Auth? Guards Or Roles?

Hey @artur33s

A very simple answer would be to use use both.

Guards should "guard" your application or parts of it from users that should not be able to access it eg. login/password. It is also called AUTHENTICATION https://laravel.com/docs/8.x/authentication

Roles should allow authenticated user to perform certain actions therefore giving such role AUTHENTICATION to do it. https://laravel.com/docs/8.x/authorization

As you can see you can also use Gates and Policies. Role would be more granular in my view then Gate or Policy.

Mar
11
3 months ago
Activity icon

Replied to Livewire Encountered Corrupt Data When Trying To Hydrate The

@felipesmendes

Whats this?

<livewire:despesas.index model="App\Models\Despesa" />

Never saw this in the official docs

Activity icon

Replied to Help Saving Array In Controller.

@michaloravec those curly braces! ;-)

Activity icon

Replied to Help Saving Array In Controller.

@ajsmith_codes

It is an array that consists of json encoded values.

To access them you need to:

$set1 = json_decode($dates[0]);
$set2 = json_decode($dates[1]);

$shipment = new Shipment();
$shipment->requested_ship_date = $set1['date1'];
$shipment->expected_delivery_date = $set1['date2'];

You get the idea.

Also to know where you are do this before anything else:

dd(json_decode($dates[0]));

and

dd($set1);

and so on until you figure it out

Activity icon

Replied to Help With Query And Subquery

@ferranmunoz

Why not use Eloquent and make your life easier?

https://laravel.com/docs/master/eloquent#introduction

When you write a monster query like this, it is always going to create issues like your initial question.

Activity icon

Replied to Laravel Handlebars Problem

@indersein I always try to use yarn instead of npm it works better in general.

Somehow there is alway that "issue" with npm.

Remove your ./node_modules

Run yarn install

https://classic.yarnpkg.com/en/docs/cli/install/

See it it helps

Activity icon

Replied to PWA

PWA does not have 2 "types" the user should choose where to install it.

Activity icon

Replied to Target ... Is Not Instantiable While Building ...

@dmhall0

It looks like the installation and auto-discovery is not working as expected.

Things to consider:

  1. Are you using the same version of PHP on both local and remote?
  2. Are you using the same version of package?
  3. Try removing composer cache and vendor folder and install it again.
  4. Check if you are using correct package version vs laravel version: https://github.com/spatie/laravel-backup/releases
  5. Ask here and describe your issue: https://github.com/spatie/laravel-backup/issues

Hope this points you in the right direction!

Mar
10
3 months ago
Activity icon

Replied to Scout CURL Error With SSL

php --ini

will tell you which files you are using and should edit.

What happens when you do:

valet unproxy
Activity icon

Replied to Scout CURL Error With SSL

@vkronlein sorry my initial though was that you were looking at this error in production. Looking thought the docs here: https://github.com/meilisearch/meilisearch-laravel-scout I can not see any reference to any proxy whatsoever.

Why do you think you need the proxy at all? Laravel valet is on your local machine, meilisearch is also on your local machine judging by your first post.

As long as you can telnet to 7700 you should be able to talk to it locally without any issues - unless it is not running?

Activity icon

Replied to Likes System Using AlpineJS - How Do I Update Likes Count?

@thebigk

Thats ok but with Livewire you will not need any of those routes or ajax calls at all. Will definately finish it faster that way ;-)

Activity icon

Awarded Best Reply on Cross Database Relationships With Different MySql User And Connections

@bhaviljain68@gmail.com

You need to declare those connections in config/database and also in .env otherwise it will always use default connection.

Activity icon

Replied to What Choose Multi Auth? Guards Or Roles?

Hey @artur33s

A very simple answer would be to use use both.

Guards should "guard" your application or parts of it from users that should not be able to access it eg. login/password. It is also called AUTHENTICATION https://laravel.com/docs/8.x/authentication

Roles should allow authenticated user to perform certain actions therefore giving such role AUTHENTICATION to do it. https://laravel.com/docs/8.x/authorization

As you can see you can also use Gates and Policies. Role would be more granular in my view then Gate or Policy.

Activity icon

Replied to Run Laravel Project Without Source Code

@bhhussain do you see the source code of this forum?

No.

So do it the same way ;-)

Activity icon

Replied to Likes System Using AlpineJS - How Do I Update Likes Count?

@thebigk I would suggest looking at laravel livewire it makes this types of interactions a breeze and you will need no javascript at all to get it to work.

You would only need to change your blade to:

@foreach($replies as $reply)
       @livewire('appointment-card', ['replay' => $replay], key($replay->id))
@endforeach

Then inside you livewire component use your html:

<li class="reply-card" x-data="{liked: @if($reply->has_user_liked) true @else false @endif}">
    <div class="post-card">
        <button :class="[liked ? 'text-red-500' : 'text-gray-500' ,'hover:text-gray-500 inline-flex space-x-2']"
                wire:click="updateLikes()"
                @click="[liked = !liked, updateLikes({{$reply->id}})]">Like</button>
        <span class="likes-count"> {{$reply->likes_count }} </span>
    </div>
</li>

Have a look at Laravel Liwewire!

https://laravel-livewire.com/docs/2.x/actions#event-modifiers

Activity icon

Replied to Cross Database Relationships With Different MySql User And Connections

@bhaviljain68

No you did not - look at the error:

user ''@'localhost'

Where are the credentials you provided?

Or there is no access to:

myApp_core.companies table

Where credentials are stored

Activity icon

Replied to Cross Database Relationships With Different MySql User And Connections

@bhaviljain68@gmail.com

You need to declare those connections in config/database and also in .env otherwise it will always use default connection.

Activity icon

Replied to Xdebug 3 With Homestead Cannot Connect To Debugging Client

Hey @automica

I tried xdebug number of times. It was always messy and instead of getting job done I was spending time getting my tooling to work.

I now use https://myray.app/ and it is definitely refreshing!

I know it does not answer your question but give it a try!

Activity icon

Replied to Change Connection Right After Login

@johnw65 https://www.php.net/manual/en/oci8.connection.php

I would still however go and use https://github.com/yajra/laravel-oci8 it in active development, if you still have the same issue just rise an issue there, I'm sure you will get appropriate answer.

Mar
04
3 months ago
Activity icon

Replied to Writing Query Inside Map

@deekshith I saw your question this morning. When you look at it it is a monnster query that only waits to break ;-)

Try moving your counts to relations first:

$catcorrectCount = UserAnswer::join('questions','user_answers.question_id','=','questions.question_id')->where('questions.test_id',$test_id)->where('questions.language',$user_tests_det->test_language)->where('user_answers.user_test_id',$user_test_id)->where('questions.question_category',$category->question_category_id)->whereRaw('user_answers.user_answer = questions.correct_option')->count();

Should become just:

UserAnswer::catcorrect()->count();

That would be a good start for me.

Activity icon

Replied to Change Connection Right After Login

Hey @johnw65

What how do you connect to your oracle database in first place? How do you establish that you actually have a connection?

Activity icon

Replied to How To Access The Relationships Via Models In Laravel 8 Inertia

@samar92 You need to show more of your code, please.

Do you call this in a vue component? I so you should fetch all the data before passing it to vue, so in your controller.

Activity icon

Replied to Info Frontend / Backend / Api Structure

@yohannes81

I feel your pain as you try to make sense of all of it ;-)

Ok one by one:

  1. What is front end - this is what users see and interact with. It should hold no logic and only display data to users and get data from users.

  2. What is backed? It is something like an admin panel where you do "stuff" with what users expect you to do eg. moderate, generate etc.

  3. Your code. Now this is where magic happens. The code you write will in the end generate frontend, generate your backend if needed and also handle API.

  4. Ok so what is API then? Well, imagine it is a front end but without all those nice html and css. In fact if you go to any of the functions in your app and at the end instead of

return view('welcome');

you do this or any other data you want:

return User::all();

You will get proper json response which is exactly what you expect from API.

5 Address of the backend - everyone can know it. You just secure it with something like Laravel Fortify.

6 File storage - look at answer 3.

7 S3 - nothing to do with any of it. You can use it or not, it has nothing to do with mobile apps or your app.

Hope that points you in the right direction!

Activity icon

Replied to How To Code For Validating Multiple Data With Similar Parameter In Compact Way For Laravel API?

Hey @nikunj001

The only ok way I saw to do this was to decode json to array and then validate the data. There is no nice "laravel" way to do it straight away with json as far as I'm aware.