Tray2

Oracle Developer (PL/SQL, Forms & Apex) at Scania CV AB

Member Since 6 Years Ago

Solna

Experience Points
427,860
Total
Experience

0 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
1611
Lessons
Completed
Best Reply Awards
386
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 50
427,860 XP
Mar
04
3 days ago
Activity icon

Replied to Two Different Laravel Projects On An Ubuntu Server, Routes In Second Project Is Not Found Gives 404 Error

You need to set up your Virtual host properly,

You should have one for "laravel1" and another for laravel2.

This link should help you

https://laravel.io/forum/05-02-2015-multiple-hosts-how-to-onedomaincom-twodomaincom-onecom-twocom-virtualhost

Activity icon

Replied to Laravel Routes Conflicting Issue

Why not just use a single route for login?

There is no reason to have one for each user type.

A user is a user is a user.

Roles should determine what the user is.

Activity icon

Replied to Jobs Processed, But Not Doing Anything

Then open a new thread and give us more information about your issue.

Activity icon

Replied to Laravel Routes Conflicting Issue

Show your code.

Activity icon

Replied to ROUTE PREFIXES ISSUE

Show us your code.

Mar
03
4 days ago
Activity icon

Replied to Anonymous Android

I had this issue as well with Twitter so I removed my twitter link and it uses the gravatar one again.

Mar
02
5 days ago
Activity icon

Replied to I Cannot Open My Website In 000webhost While Adding Twilio Sdk With Out It My Website Work Well

Make sure your document root is /storage/ssd1/745/15653745/public_html/public. Also make sure the your storage directory has the correct permissions

Activity icon

Replied to Where Doesn't Have Relation

Wouldn't this work?

$products = Product::whereIn('id', $this->selected)
  ->with(['records', function ($query) {
      $query->doesntHave('parts');
  }])->get();
Mar
01
6 days ago
Activity icon

Replied to Help Need For Calculated Sql Collection

Still not making any sense.

If you create a sale you store it in a sales table with a created_at right?

Then you can count the records and group them by the sales date to get the number of sales that day.

Activity icon

Replied to Help Need For Calculated Sql Collection

So the logic is

  • 5-1 = 4
  • 8-5 = 3
  • 11-8 = 3

And so on?

If so you need a recursive query.

Not knowing what RDBMS you are using but here is some info about recursive queries

https://stackoverflow.com/questions/20215744/how-to-create-a-mysql-hierarchical-recursive-query

Feb
27
1 week ago
Activity icon

Replied to Npm Run Hot Doesn't Work With Laravel Mix

I'm not running on a Windows machine here so I can't try to replicate the issue.

I suggest you check out Laravel/Sail then you will have a good lemp setup.

https://laravel.com/docs/8.x/sail

Activity icon

Replied to Receive Wrong Html Response Rather Than Xml/json In Curl Request

Most likely yes. They don't have any limit on the amount of requests but rather the amount of request within a certain time limit. They might have set it to 20 requests per minute or somesuch.

Not throttling a API can cause performance issues for the provider not to mention opening for DDOS. Even unintentional ones.

I suggest setting a sleep time between the calls to keep them outside the threshold.

Activity icon

Replied to Where To Learn? ... Tried Laracasts!

The changes between Laravel 6 and 8 are not big enough to warrant a new series (even if I wouldn't mind one myself).

I recommend watching the What is new in Laravel 7 and 8 series to get up to speed on the major changes.

I can recommend getting the Base Laravel course here https://baselaravel.com/

If you get stuck on something the community here will do it's best to help you solve the issues you face.

Activity icon

Replied to Npm Run Hot Doesn't Work With Laravel Mix

Where ever you defined this

\js\app.js

Try changing it to

/js/app.js
Activity icon

Replied to Receive Wrong Html Response Rather Than Xml/json In Curl Request

Most likely you have hit the max number of requests within a certain time span. Thus giving you the error.

Feb
26
1 week ago
Activity icon

Replied to Calculate The Price In Kg Depending On The Country

You can leverage the database for that. Just pass in the country code and the weight and get the cost

Activity icon

Awarded Best Reply on Request Array Has A Max Limit If 119?

Most likely because of this

 name="tool[{{ $key }}]

You have 6 for each tool and you have a a lot of tools to loop over.

Activity icon

Replied to Request Array Has A Max Limit If 119?

Most likely because of this

 name="tool[{{ $key }}]

You have 6 for each tool and you have a a lot of tools to loop over.

Activity icon

Replied to How To Automatically Add A Row Number

@tykus so I noticed when I posted my reply.

Activity icon

Replied to How To Automatically Add A Row Number

If you are using blade you have a index variable you can use.

https://laravel.com/docs/8.x/blade#the-loop-variable

The you can use $loop->index as your row number.

Feb
25
1 week ago
Activity icon

Replied to I Cannot Open My Website In 000webhost While Adding Twilio Sdk With Out It My Website Work Well

How did you add it? What version of Laravel are you using?

Activity icon

Replied to Oracle Error: ORA-02391

Ask the DBA to increase the amount of connections then.

Activity icon

Replied to Error In Query

If you store the images on disk it's a bit of waste in bandwidth. Just put them on an S3 bucket and pass along the link and let the frontend people be responsible for the loading of the picture.

Activity icon

Replied to What Courses To Take

The best place to start is always here

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

Then you can move on the the What's new in Laravel 7 and 8.

After that one of the courses using TDD.

Activity icon

Replied to Error In Query

Why are you passing the encoded image instead of just the path to the image?

Activity icon

Replied to Invalid Text Representation With Pgsql

Yes, a roles table is much better practice.

Activity icon

Replied to Error In Query

Add this after your query

dd($location); 

Then you will see what is wrong.

Since you get more than one row you need to loop over your collection.

Activity icon

Replied to How To Get More Informative Errors From PHPUnit?

When it comes to validations I usually do something like this

  /**
     * @test
     * @dataProvider storeValidationProvider
     * @param $fieldValue
     * @param $field
     */
    public function store_validation_tests($field, $fieldValue)
    {
        $book = Book::factory()->make([
            $field => $fieldValue
        ]);

        $response = $this->post('/books', $book->toArray());
        $response->assertStatus(302);
        $response->assertSessionHasErrorsIn($field);
    }

    public function storeValidationProvider()
    {
        return [
            'the title is required' => ['title', ''],
            'part must be numeric' => ['part', 'One'],
            'format_id is required' => ['format_id', ''],
            'format_id must exist in formats' => ['format_id', 100],
            'genre_id is required' => ['genre_id', ''],
            'genre_id must exist in genres' => ['genre_id', 100],
            'isbn is required' => ['isbn', ''],
            'invalid isbn10 cant be stored' => ['isbn', '123456789'],
            'invalid isbn13 cant be stored' => ['isbn', '9771234567890'],
            'released is required' => ['released', ''],
            'pages is required' => ['pages', ''],
            'pages must be numeric' => ['pages', 'Ten'],
            'blurb is required' => ['blurb', ''],
            'released cant be earlie than 1800' => ['released', 1799],
            'released cant be later than current year + 1' => ['released', Carbon::now()->addYear(2)->year],
            'reprinted cant be earlier than 1800' => ['reprinted',  1799],
            'reprinted cant be later than current year + 1' => ['reprinted', Carbon::now()->addYear(2)->year]
        ];
    }

So when thisd is 'the title is required' => ['title', ''] then I assert the the title field is in the errors

 $response->assertSessionHasErrorsIn($field);
Activity icon

Awarded Best Reply on Issue With Bat File On Windows

You don't have php.exe in your path.

https://docs.alfresco.com/4.2/tasks/fot-addpath.html

Feb
24
1 week ago
Activity icon

Commented on Introduction And Styling

Is there any specific reason for not using the new html 5 tags instead of using divs in your html?

I think the code becomes much more easy to read when using them.

And why aren't you using a table to display the tabular data in the future weather?

Feb
22
1 week ago
Activity icon

Awarded Best Reply on SQLSTATE[22007]: Invalid Datetime Format: 7

This is your problem

(2020-04-06 12:46:31.000000, 3, UTC)

Since you use in in your query it reads the , as that the next is a new value.

Where is the controller code that creates the query cause there most likely lies the issue.

Activity icon

Replied to BigSur?

No issues what so ever found so far.

Feb
21
2 weeks ago
Activity icon

Awarded Best Reply on Change Php Versions Using Valet

You need to uninstall Valet and install it again and most likely run

valet use [email protected]

You can always check this link as well

https://github.com/laravel/valet/issues/861

Also try this

brew unlink [email protected]
brew link [email protected]
Activity icon

Replied to Seacrch WYSIWYG For Laravel/tailwindcss/Blade/Alpine App?

You mean something like tinymce or ckeditor?

Activity icon

Replied to Change Php Versions Using Valet

You need to uninstall Valet and install it again and most likely run

valet use [email protected]

You can always check this link as well

https://github.com/laravel/valet/issues/861

Also try this

brew unlink [email protected]
brew link [email protected]
Activity icon

Replied to 500 | SERVER ERROR Appeared After Uploading File To Shared Hosting.

Can you give us the full error message?

Feb
20
2 weeks ago
Activity icon

Replied to Necessity Of Changing Blade Template Into Vue.js/react Js In Laravel Website?

If I were you I'd stick to blade where ever I could get away with it and just use javascript where needed.

Activity icon

Replied to Seeder Not Work

Are you sure you are running it?

Check your DatabaseSeeder Class that you have the following line

$this->call(ProductVariationsTableSeeder::class);
Activity icon

Replied to MySQL Performance With URL Slug As Key?

I bet you will :)

Activity icon

Replied to MySQL Performance With URL Slug As Key?

The id will always be a little bit faster since it's numeric and is then "easier" for the database to index and perform searches against. However an indexed slug should not post any major slowdowns in a reasonably large table. There are more ways to handle performance if you have performance issues with a huge table even if it's indexed properly. In that case you can partition the table.

You can also use two fields for uniqueness to help the index along. For a simple blog you could consider using they year + the slug as the unique key.

Feb
19
2 weeks ago
Activity icon

Replied to Weird Js Issue

42

Activity icon

Replied to WhereJsonContains() Equivalent For SQLite Database

You have two options

  1. Don't use json fields in your database for other things than store the payload before parsing it into normal fields in a table.
  2. Use a MySQL database for your tests.

I would go with option 1. seven days a week, since a storing json in your database like that defeats the whole purpose of a relational database.

Feb
18
2 weeks ago
Activity icon

Replied to Laravel Check Box To Textbox?

Not sure what you mean?

Are you saying that you want to validate that if a checkbox is checked then a textbox is required?

If so check the rule requiredif

https://laravel.com/docs/8.x/validation#rule-required-if

Activity icon

Replied to How To Create An Update Module For Laravel?

One option is to use an Artisan command that updates the files/tables you need.

Activity icon

Replied to Like And Dislike Using Ajax In Laravel

I would add and remove CSS classes with js when the button is clicked. I would do the initial rendering of the class list in my blade template.