Sinnbeck

Sinnbeck

Programmer at Aalund

Member Since 5 Years Ago

Hadsten

Experience Points
641,690
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
163
Lessons
Completed
Best Reply Awards
1001
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.

Level 50
641,690 XP
Sep
27
4 hours ago
Activity icon

Replied to Call To A Member Function Dokumen() On Null

What is $data? Show how it is set

Activity icon

Replied to Call To A Member Function Dokumen() On Null

For that to work yes. But you are the only one who knows what $data is supposed to be. Perhaps if you showed how it is set

It kinda looks like a paginator, but that would be wrong

Activity icon

Replied to Call To A Member Function Dokumen() On Null

That looks like a single item

$data->dokumen()->create
Activity icon

Replied to Call To A Member Function Dokumen() On Null

Show how you get $data then

Activity icon

Replied to Call To A Member Function Dokumen() On Null

That is the cause of the error. Then try doing the same on just data

dd($data);
Activity icon

Replied to Call To A Member Function Dokumen() On Null

Can you try dumping on the line before?

dd($data[$type]);
Sep
26
1 day ago
Sep
25
2 days ago
Activity icon

Awarded Best Reply on How Do You Keep Your Scss Files Cleaned?

Perhaps you should give tailwind a try. It has all the classes you need, and will automatically remove those you don't use when compiling for production

Activity icon

Awarded Best Reply on Remove Double Quote

Happy to help. Casting can be confusing :) Rule of thumb. Only cast to array if the column contains json :)

Activity icon

Awarded Best Reply on HTTP ERROR 500

sudo apt install php7.4-common
Activity icon

Awarded Best Reply on How To Make Jpg File From A Blade View In Laravel (making Certificate For Users)

Seems you are somehow using wkhtmltopdf instead of wkhtmltoimage

Check this path and filename is correct https://github.com/barryvdh/laravel-snappy/blob/master/config/snappy.php#L46

Activity icon

Replied to HTTP ERROR 500

sudo apt install php7.4-common
Activity icon

Replied to Form Data Not Transmitted On Submit

It does not seem that you are following it totally

You have this in the template

v-model="current_post.title"  //etc. 
instead of
v-model="form.title"
Activity icon

Replied to HTTP ERROR 500

@atef95 Try setting a directory index in the Virtual host file (remember to reload apache)

DocumentRoot /var/www/html/journey/public
DirectoryIndex index.php
Activity icon

Replied to GET Method Is Not Supported For Homepage

Did you chance anything in web.php? Check your logs. And you can try enabling debug in .env (APP_DEBUG=true)

Activity icon

Replied to HTTP ERROR 500

Check /var/logs/apache2/error.log

Activity icon

Replied to HTTP ERROR 500

@laracoft Hard to tell without seeing the virtual host file. Perhaps it isnt set up to point to the project at all?

Activity icon

Replied to Model::decrement() And Model::increment() Not Working Efficiently

Can you show the code you are using for storing the amounts as well? If you store it in multiple places, please show them all.

Activity icon

Replied to HTTP ERROR 500

You should never point your virtual host file to the root of the project. Point it to the public folder.

Can you show your apache virtual host file? It should be stored at something like

/etc/apache2/sites-available/name.conf

It should be something like

<VirtualHost *:80>
    ServerName example.com
    DocumentRoot /path/to/project/public
    DirectoryIndex index.php

  <Directory "/path/to/project/public">
      AllowOverride All
      Options +FollowSymLinks +Indexes
      Order allow,deny
      Allow from all
  </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>
Activity icon

Replied to GET Method Is Not Supported For Homepage

Yeah optimize is just

        $this->call('config:cache');
        $this->call('route:cache');
        $this->call('view:cache');

and optimize:clear is

        $this->call('view:clear');
        $this->call('cache:clear');
        $this->call('route:clear');
        $this->call('config:clear');
        $this->call('clear-compiled');
Activity icon

Replied to GET Method Is Not Supported For Homepage

@automica Yeah it is a bit strange. Be aware that optimize runs all caches, and optimize:clear clears all caches.

Edit: newer was removed it seems :) https://github.com/laravel/framework/commits/e899d314a78ef16968e3e410529ba6660a7a25ab/src/Illuminate/Foundation/Console/OptimizeCommand.php

Activity icon

Awarded Best Reply on GET Method Is Not Supported For Homepage

Never cache your config or routes or anything else when developing. Caching is only for production!

Run this to clear all caches

php artisan optimize:clear
Activity icon

Replied to GET Method Is Not Supported For Homepage

Never cache your config or routes or anything else when developing. Caching is only for production!

Run this to clear all caches

php artisan optimize:clear
Activity icon

Replied to Laravel / Spatie / Mailgon Webhooks - Invalid Signature

You might need to make a custom signature validator

Here is mine (not using that package, but you perhaps add your own (this is taken more or less from the official docs)

protected function validate(array $signature, $api_key = null)
    {
        $timestamp = $signature['timestamp'];
        $token = $signature['token'];
        $signature = $signature['signature'];
        //Concat timestamp and token values
        if (empty($timestamp) || empty($token) || empty($signature)) {
            return false;
        }
        $api_key = $api_key ? $api_key : config('mailgun.api_key');

        $hmac = hash_hmac('sha256', $timestamp.$token, $api_key);
        if (function_exists('hash_equals')) {
            // hash_equals is constant time, but will not be introduced until PHP 5.6
            return hash_equals($hmac, $signature);
        } else {
            return $hmac === $signature;
        }
    }

https://github.com/spatie/laravel-webhook-client#creating-your-own-signature-validator

Activity icon

Replied to What Password Hash Is The Laravel Using For Passwords???

And easy solution is to just run php artisan tinker and then paste these lines one at the time (replace with your own info)

$user = new App\Models\User();
$user->password = Hash::make('the-password-of-choice');
$user->email = '[email protected]';
$user->name = 'My Name';
$user->save();
Activity icon

Replied to 422 Unprocessable Entity On Updating Record With Image

Who are you writing to? Did you reply to me or @tykus ?

And if you replied to me, what are you getting now?

Activity icon

Replied to Submitting Form With Danish Letters In Input

@fredemagi Danish guy here. Works perfectly for me :) Can you show your blade file? If it extends a layout, then post that

Activity icon

Replied to 422 Unprocessable Entity On Updating Record With Image

You can do it manually to work with ajax

$validator = Validator::make($request->all(), [
            'title' => 'required',
            'description' => 'required',
            'news_image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:5100'
        ]);
if ($validator->fails()) {
//here we check if it is an ajax request and return a more useful response :)
            if($request->ajax())
            {
                return response()->json(array(
                    'success' => false,
                    'message' => 'There are incorect values in the form!',
                    'errors' => $validator->getMessageBag()->toArray()
                ), 422);
            }
$this->throwValidationException(

                $request, $validator

            );
}
Activity icon

Replied to Laravel 8 - Pagination Not Showing Numbers

How many users are in your database?

Activity icon

Awarded Best Reply on Session Destroy After Redirect Other Route?

Just update the redirectTo method in App\Http\Middleware\Authenticate

Activity icon

Replied to How Do You Keep Your Scss Files Cleaned?

Perhaps you should give tailwind a try. It has all the classes you need, and will automatically remove those you don't use when compiling for production

Activity icon

Replied to Printing Table Without Knowing Column Names?

$columns = Schema::getColumnListing('articles');
Activity icon

Awarded Best Reply on Theme Module With Laravel 8

Ok an easy solution could maybe be to read the theme key and pass that with the view?

return view($theme . '.users.show');
Activity icon

Awarded Best Reply on Kontak

The class seems to be called something like vc_col-sm-4

Sep
24
3 days ago
Activity icon

Replied to How To Access All Variable Data In In Ajax Success Function ?

And what does this give you?

console.log(item)
Activity icon

Replied to UPDATE USER ON THR PROGRESS OF A RUNNING QUEUE

If using livewire you can also use livewire poll. But you would need to store to the db that a mail was sent

https://laravel-livewire.com/docs/2.x/reference

Search for wire:poll

Activity icon

Replied to Laravel Route Was Not Detected After Enabling Php Artisan Optimize

Optimize caches everything including routes. Never run it, or any cache commands on your development computer

Run php artisan optimize:clear to remove the caching again

Activity icon

Awarded Best Reply on LARAVEL INSTALLATION > New Day > New Topic > New Question

Try restarting your terminal

Activity icon

Replied to Any Idea How I Can Refactor This ? What Is Best Practice ?

You could refractor these to methods with more telling names

$status === $event::PENDING && $event->approved_by == null)

vs

$this->isBalanceResetAllowed($event) //just guessing what it checks for
Activity icon

Replied to LARAVEL INSTALLATION > New Day > New Topic > New Question

Try restarting your terminal