srasch

Lead Developer at AKF

Member Since 4 Years Ago

Dresden

Experience Points
41,360
Total
Experience

3,640 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
377
Lessons
Completed
Best Reply Awards
4
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 9
41,360 XP
Oct
22
6 days ago
Activity icon

Awarded Best Reply on More Readable Blade With Tailwind And Livewire

I personally would use Blade components to make it look "cleaner"

<div>

    @if (session('status'))
      {{ session('status') }}
    @endif
    
    <form wire:submit.prevent="submit_action">

        <x-input.text wire:model="name" />
        
        <x-input.text wire:model="email"
                      type="email"/>
        
        <x-input.textarea wire:model="body" />
        

        <x-button.loading wire:target="submit_action"
                          color="indigo">
            Submit
        </x-button.loading>
        
    </form>
</div>

components/input/text.blade.php:

<div>
    <input {{ $attributes->merge('class' => 'bla your-standard-input-classes') }} />

    @error($attributes['wire:model'])
      <x-validation-error>
        {{ $message }}
      </x-validation-error>
    @enderror
</div>

components/input/textarea.blade.php:

<div>
   <textarea {{ $attributes->merge(['class' => 'bla your-standard-input-classes']) }}></textarea>

    @error($attributes['wire:model'])
      <x-validation-error>
        {{ $message }}
      </x-validation-error>
    @enderror
</div>

components/button/loading.blade.php:

@props([
    'color' => 'indigo'
])

<button {{ $attributes->merge(['class' => "bg-{$color}-600"]) }}
        wire:loading.attr="disabled"
        wire:loading.class="bg-{{ $color }}-500"
        wire:loading.class.remove="bg-{{ $color }}-600">
    {{ $slot }}
    <span {{ $attributes['wire:target'] }} wire:loading>
        ...
    </span>
</button>

components/validation-error.blade.php:

<p {{ $attributes->merge(['class' => 'mt-1 text-xs text-red-600']) }}>
    {{ $slot }}
</p>
Oct
21
1 week ago
Activity icon

Replied to More Readable Blade With Tailwind And Livewire

<span wire:target="{{ $attributes['wire:target'] }}" wire:loading> :)

...so you don't have to repeat it in the button and the span element if it's the same.

Activity icon

Replied to More Readable Blade With Tailwind And Livewire

@laracoft I edited my last answer and added to corrections. sorry for that I just did it on the fly :)

I recommend to make a components/button folder for different components, like primary, danger, secondary, loading, link etc.

Activity icon

Replied to More Readable Blade With Tailwind And Livewire

I personally would use Blade components to make it look "cleaner"

<div>

    @if (session('status'))
      {{ session('status') }}
    @endif
    
    <form wire:submit.prevent="submit_action">

        <x-input.text wire:model="name" />
        
        <x-input.text wire:model="email"
                      type="email"/>
        
        <x-input.textarea wire:model="body" />
        

        <x-button.loading wire:target="submit_action"
                          color="indigo">
            Submit
        </x-button.loading>
        
    </form>
</div>

components/input/text.blade.php:

<div>
    <input {{ $attributes->merge('class' => 'bla your-standard-input-classes') }} />

    @error($attributes['wire:model'])
      <x-validation-error>
        {{ $message }}
      </x-validation-error>
    @enderror
</div>

components/input/textarea.blade.php:

<div>
   <textarea {{ $attributes->merge(['class' => 'bla your-standard-input-classes']) }}></textarea>

    @error($attributes['wire:model'])
      <x-validation-error>
        {{ $message }}
      </x-validation-error>
    @enderror
</div>

components/button/loading.blade.php:

@props([
    'color' => 'indigo'
])

<button {{ $attributes->merge(['class' => "bg-{$color}-600"]) }}
        wire:loading.attr="disabled"
        wire:loading.class="bg-{{ $color }}-500"
        wire:loading.class.remove="bg-{{ $color }}-600">
    {{ $slot }}
    <span {{ $attributes['wire:target'] }} wire:loading>
        ...
    </span>
</button>

components/validation-error.blade.php:

<p {{ $attributes->merge(['class' => 'mt-1 text-xs text-red-600']) }}>
    {{ $slot }}
</p>
Oct
16
1 week ago
Activity icon

Replied to Disable Mobile Version

Just remove the right meta-tag <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">or something similar in your case.

Activity icon

Replied to Eliminate Render-blocking Resources

First of all, I would concat all these css file into one single file.

Then you can purge it, so you only have the styles you really need to avoid uneccessary styles.

You also can do something like this: <link rel="preload" href="/style.css" as="style" />

This helps browsers prioritize when to download assets and which assets to load.

Activity icon

Replied to Can't Load Components

Could you please submit a more specific screenshot or snippet?

Oct
15
1 week ago
Activity icon

Replied to New Stripe Checkout Successful Implementation

Hey!

Miguel has a great and simple snippet for it.

Give it a try:

https://miguelpiedrafita.com/snippets/stripeCheckout

Activity icon

Replied to Cashier Coupon Not Found

The code looks good. I think something went wrong creating the coupon.

Could you submit a screenshot from your dashboard or submit the response from GET /v1/coupons?

Thanks

Activity icon

Replied to Handle Multiple Eloquent Model DB Connections In Jobs - Based On The Settings Stored In Database

Hey @andraszoltan,

you can create a helper function for custom database connections like this:

<?php


namespace App\Helpers;

use App\CompanySettings;
use Illuminate\Database\ConnectionInterface;
use Illuminate\Support\Facades\{Config, DB};


class CustomDatabaseConnection
{


    public static function setConnection( $companySettingsId ) : ConnectionInterface
    {

        // grab your id - this is just guessing by me :)
        $companyConnection = CompanySettings::where('company_id', $companySettingsId)->first();

        Config::set('database.connections.' . $companyConnection->company_id, [
            'driver'   => 'mysql',
            'host'     => $companyConnection->server_ip, // or how it's stored in your db
            'database' => $companyConnection->database_name,
            'username' => $companyConnection->database_user,
            'password' => $companyConnection->database_password
        ]);

        return DB::connection($companyConnection->company_id);
    }
}

and you can use it like this:

$connection = CustomDatabaseConnection::setConnection($companySettings->whatever);

$connection->table('myTable')->insert([...]);

// your work

$connection->disconnect();
Oct
14
2 weeks ago
Activity icon

Awarded Best Reply on Task Scheduling With An Invokable Object

Feel free to place them where you want to.

You can e.g. create a folder in your app direction called "Services" or "Helpers" or "Action" to place them.

Activity icon

Replied to If Condition In Blade Call

Try this:

 <x-tab path="/items?topic={{$topic->title}}" 
            {{ $topic->title == request('topic') ? 'type="active"' : '' }}">
         {{$topic->title}}
 </x-tab>
Activity icon

Replied to Task Scheduling With An Invokable Object

Feel free to place them where you want to.

You can e.g. create a folder in your app direction called "Services" or "Helpers" or "Action" to place them.

Activity icon

Awarded Best Reply on What's The Best Approach?

I think this makes not much difference.

app() returns a container instance and accepts two params. $abstract and $parameter. If you set the first parameter like you did, it resolves the given type from the container which is nothing more like in B.

For deeper information check: \Illuminate\Foundation\helpers.php \Illuminate\Container\Container.php

Activity icon

Replied to What's The Best Approach?

I think this makes not much difference.

app() returns a container instance and accepts two params. $abstract and $parameter. If you set the first parameter like you did, it resolves the given type from the container which is nothing more like in B.

For deeper information check: \Illuminate\Foundation\helpers.php \Illuminate\Container\Container.php

Aug
17
2 months ago
Activity icon

Replied to Email Retrieve

If you don't want any test transactions you just have to move your Stripe account from "Testing" to "Live".

You also do not need to send emails by yourself. Stripe will handle this for you.

Check the Billings section.

Activity icon

Replied to How To Replace Readonly To No Pointer Event?

You can do it like this, if I understood your issue correctly:

<div class="row">
    <div class="col-md-12">
        <div class="form-group">
            <label for="store_id">Store Name</label>
            <span id="lblinfo" style="color: #F00">*</span>
            <select {{ isset($externalPayment) ? "id='type'" : "" }} class="form-control" name="store_id" id="store_id">
                @foreach ($stores as $index => $store)
                    <option value="{{ $index }}" {{ isset($externalPayment['store_id']) && $externalPayment['store_id'] == $index ? 'selected' : '' }}> {{ $store }}</option>
                @endforeach
            </select>
        </div>
    </div>
</div>
Activity icon

Replied to Automated Deployment Of Github Repo On Forge Errs With "Untracked Working Tree File" For Phpinfo() Index File

Hey,

what do want to install? A "standard" PHP appication or an new Laravel application?

I did something familiar, but instead of creating a new site on an existing server, I'm always triggering a new server creation/installation like this:

  1. createServer
  2. createMysqlUser
  3. updateSite(because I don't want it as default)
  4. installGitRepositoryOnSite
  5. updateSiteEnvironmentFile (important BEFORE deploying the repo)
  6. getDeploymentScriptand updateSiteDeploymentScript
  7. enableQuickDeploy
  8. deploySite

If you need help in this specific case just use the support chat on Laravel Forge. James & the Team will help almost immediately. They are doing a great job!

Aug
14
2 months ago
Activity icon

Replied to How Do I "ssh Into Sites Directory"?

If you are logged in via ssh you can cd into your site by „cd default“ (if you have not set a site name/domain) or „cd www.yourdomain.com“.

Before, you can show all directories by typing ls -a.

Hope it helps.