_stefanzweifel

_stefanzweifel

Member Since 4 Years Ago

Zurich

Experience Points
34,195
Total
Experience

805 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
490
Lessons
Completed
Best Reply Awards
4
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 7
34,195 XP
Dec
31
9 months ago
Activity icon

Replied to Is There A Shorthand To Schedule Commands To Be Queued?

Artisan::queue('email:send', [
    'user' => 1, '--queue' => 'default'
]);

The '--queue' => 'default'-part in your example doesn't automatically queue the artisan command. This is just an option which is passed to the email:send command. The command would then have to read the option and implement the queue itself (https://laravel.com/docs/master/artisan#defining-input-expectations)

May I ask, what exactly you want to accomplish and why? Why do you want to schedule an artisan command?

Why don't you use Jobs? (It seems you already have experience with jobs)

Dec
17
10 months ago
Activity icon

Replied to Add A Global Method To All Eloquent Models.

Create a BaseModel with your "global method". All other Models then have to extend from your BaseModel.

Why don't you want to use Traits?

Activity icon

Replied to Forge Support?

@SUSTAINED - I think Taylor once mentioned on Twitter, that you would have to disable AdBlocker on Forge, as they block the support widget.

(I would be obviously better if there would just be an email-address or an alert-message about that.)

Activity icon

Replied to Filesystem Disk Per User

@KIMA - That's what I had in my head. Didn't know about createLocalDriver

Activity icon

Replied to Filesystem Disk Per User

You could try adding this in the boot method in your AppServiceProvider.

public function boot()
{
    // other stuff

    if (auth()->check()) {
        $disks = config('filesystem.disks');

        $userDisk = [
            'userdisk'=> [
                'driver' => 'local',
                'root' => storage_path('app/public/'. auth()->user()->name .'/'),
                'url' => env('APP_URL').'/storage',
                'visibility' => 'public',
            ]
        ];

        $mergedDisks = array_merge($disks, $userDisk);

        config(['filesystem.disks' => $mergedDisks]);
    }
}

It works, but it doesn't feel right. I see config files as not updatable by the app itself, only by me. Maybe a wrapper class around Laravel's Filesystem Class which always prefixes the path with the username? (And just a hint: Have you considered what happens when a user changes his name?)

Dec
16
10 months ago
Activity icon

Replied to Date Filter

Are assignment_start_date and assignment_end_date dates or timestamps? You might want to change your query to include 2018-01-01 00:00:00 and 2018-06-05 23:59:59.

As you already know that you have more than 10 assignments, you should compare your query against the attributes of the assignments which are not returned by the query.

Activity icon

Replied to Horizion - Queue Worker On Forge Vs. App Config Code (queue.php / Horizion.php)

The "Queues" tab on Forge is not connected with Horizon. Adding a new worker through the Queues tab results in a worker that runs php artisan queue:work. Docs

If you want to use Horizon and your setup you have in config/horzion.php you would have to start a new Daemon. You can add a new one in the Servers > Daemons tab in Forge.

The command would be php artisan horizon and the directory would be something like /home/forge/example.com/. Don't forget to add php artisan horizon:terminate to the deploy script of your site to automatically restart the Horizon worker after each deployment.

Are these going to be any different to what I have setup within the config. Should I run both or just one of them?

So yes, using using the "Queues" tab results in different queue workers than with Horizon. As you've already installed Horizon I would highly recommend to stick to Horizon and it's config file.

Activity icon

Replied to Unable To Install Github Repo

Hi ?

As you've already learned, this sounds like an authentication error between Forge and Github. Do you see "Laravel Forge" in Githubs's list of Authorized OAuth Apps? If not you can reauthorize Github in Forge's settings page here.

Or it is connected with your server. When I provision a new server through Forge, I always receive an email from Github about a newly added SSH-key to my account with the name of the server. Did you receive that?

If not, can you deploy the Repo on your production server? Have you tried provisioning a new server and add the repo to the new server? If that would work, I would suggest destroying the old server and just use the new one.

Activity icon

Replied to Laravel JSON Encryption

Laravel does not encrypt the data when you return an array from a Controller. It simply converts the array to JSON.

You can use the encrypt() and decrypt() helpers in your Laravel Backend to encrypt the data (and store in in a database for example), but to display the data in a Vue.js Frontend you would have to use decrypt() in the API ... which is what you want to avoid, right?

So it sound like you want to use End-to-End encryption. I've used aes.js in the past to create a little demo app. Here's my article and the code for the demo app.

In short:

  • you would have to store an encryption key in your frontend
  • the Vue.js app will encrypt an array or object with aes.js and send the encrypted data to your Laravel API endpoint
  • the Laravel app will store the data in the database (or maybe encrypt it again on the server side?)
  • another Laravel API endpoint will fetch the data from the database and return the still encrypted data.

Keep in mind: Your Laravel app will receive the data encrypted. So you can't really do anything with besides storing it in the database.

Nov
17
1 year ago
Activity icon

Replied to Dusk Works Without Opening Browser!

Since 2.0, Dusk ships with "Chrome headless" (https://developers.google.com/web/updates/2017/04/headless-chrome). "headless" means it does not open the browser-window and you can't see what Dusk is doing.

This improves the performance of your Test Suite a lot. You could override the driver-method in your DuskTestCase to remove the --headless-option like so :

    protected function driver()
    {
        $options = (new ChromeOptions)->addArguments([
            '--disable-gpu'
        ]);

        return RemoteWebDriver::create(
            'http://localhost:9515', DesiredCapabilities::chrome()->setCapability(
                ChromeOptions::CAPABILITY, $options
            )
        );
    }

Source: https://github.com/laravel/dusk/blob/2.0/stubs/DuskTestCase.stub#L34

Mar
22
3 years ago
Activity icon

Replied to Mandrill To Sparkpost?

I would suggest using the SMTP Credentials. So you just grab the SMTP Infos from Sparkpost (account required), and paste them in your Laravel Application. Done.

Feb
25
3 years ago
Activity icon

Replied to More Vue, Less Blade

I personally use $with with great care. My project at works handles a TON of data. Eloquent would have to search 1-5 relations in a table with 500k rows. This can get really slow ...

If you're app is smaller, I would say it's a great starting point.

Sep
17
4 years ago
Activity icon

Replied to Class 'App\Http\Controllers\Spatie\Browsershot\Browsershot' Not Found

Happy I could help @lucasvrm. But could you please remove your API key from your recent post? API keys should be like passwords and never posted in public. Thank you :)

Jun
28
4 years ago
Activity icon

Replied to Install Vue.js Via Npm And Use It

@bart Indeed. It get's more confusing every day :(

Jun
27
4 years ago
Activity icon

Replied to Install Vue.js Via Npm And Use It

I just installed Vue in a new project.

I created a new file resources/assets/js/app.js and in there I require Vue like so:

var Vue = require('vue');

In my gulpfile.js I added this mix:

mix.browserify('app.js');

Browserify will then search the Vue.js source on it's own and inject it in the final file.

Jeffrey also made a video for that: https://laracasts.com/series/learning-vuejs/episodes/9

Activity icon

Replied to What Is The Best Way To Update One Field With Rows Resulting 15k?

You can use chunk() for that. Quick example from the docs (http://laravel.com/docs/5.1/eloquent#retrieving-multiple-models):

User::chunk(200, function($users)
{
    foreach ($users as $user)
    {
        // Execute the row update here
    }
});

Or if all 15k rows should update with the same value:

Model::whereIn('id', $arrayOfIds)->update(['field' => $value]);
Mar
18
4 years ago
Activity icon

Replied to Question L5 Bower

For styles() and scripts() you could also specify the root folder. I've written about this approach here.

mix.scripts([
    'vendor/package-name/package.js',
    'vendor/antoher-package-name/another-package.js',
    'js/app.js',
], 'public/app.js', 'resources/');
Activity icon

Replied to Question L5 Bower

You can add a .bowerrc file in the root of your project with the following content:

{
    "directory": "resources/vendor"
}

resources/vendor is then your new bower_components folder.

Feb
18
4 years ago
Activity icon

Replied to Log Database For Updated And Deleted File

So you mean something like a "Revision"? If you're still on Laravel 4 I can recommend Venturecraft/revisionable. Pretty easy to setup and works great!

Jan
19
4 years ago
Activity icon

Replied to Grab Screenshots From Websites / App I Wrote

@bashy In current version: no. The screenshot is created through PhantomJS. So Screeenly doesn't have your login cookies. But this could be a feature in the distant future... But honestly, I don't have any idea how you could accomplish the login flow in PhantomJS.

Activity icon

Replied to Grab Screenshots From Websites / App I Wrote

@MThomas On my bucket list! Will add this in the upcoming days.

Activity icon

Replied to Grab Screenshots From Websites / App I Wrote

@bashy @Graham I think when Droplr changed their plans the last time, they also killed the API.

Screeenly and Droplr can not be compared together. Droplr is a client-software and lives in your menubar. Screeenly on the other side is just a API endpoint you can call in your own applications. If you use the screeenly-client Package you can do something like this:

$screenshot = Screenshot::capture('https://laracasts.com');
$path = $screenshot->store('path/where/you/store/images');

This can be handy if you have a dashboard of pages you created (like a portfolio or a company internal application). Maybe the punchline on the landingpage is a bit unclear. Will probably change that to something more descriptive.

Activity icon

Replied to Grab Screenshots From Websites / App I Wrote

@bashy Didn't know Droplr can do that. Will test it out.

Jan
18
4 years ago
Activity icon

Started a new conversation Grab Screenshots From Websites / App I Wrote

Hi folks

I don't know if this forum is the right place, but I would like to share a Laravel application I recently built.

Screeenly helps you create screenshots from websites, so you can use them in your own application. Thanks to Jeffrey I learned a ton about PHP and OOP and I used Screeenly as a learning project to apply some of the techniques and patterns. It's for sure not THE best code of mine, but when Laravel 5 will be released, I will probably rebuilt the application, so I can use all the new awesome L5 stuff. I open sourced it because I didn't find nearly no Laravel application on Github and I wanted to share, how I structure my code. Maybe this is a inspiration to others ;)

There is also a composer package which works great with Laravel 4, so you don't have to struggle with the API itself. Maybe this is something for you.

Feedback is always appreciated :)

Have a nice sunday :) Stefan