manogi

manogi

Member Since 3 Years Ago

Experience Points 35,655
Experience
Level
Lessons Completed 396
Lessons
Completed
Best Reply Awards 3
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

07 Nov
6 days ago

manogi left a reply on Tiny Bug In The New Design

And another tiny one (you can see I am looking a lot at my new profile page at the moment ;-):

The "School In Session" award does not seem to count right - I am pretty sure I have completed a few series by now.

Cheers!

manogi started a new conversation Tiny Bug In The New Design

First of all: I love the new design, and I like the fact a lot that you change the design that often.

Secondly: there will ALWAYS be some minor bugs/glitches that fall through the cracks when testing your own design, and here is a little one I found:

When you roll over the badges in your profiles page (and your browser window is not wider than let's say 1400px) , the litte explanation bubble of the disappears partly because it stretches beyond the browser's edge.

Otherwise: thumbs up and thanks for giving us something new to look at!

01 Nov
1 week ago

manogi left a reply on How Do You Properly Check If A Record Exists?

No need for 'isEmpty()and also no need for the second ìftatement. This should be enough:


if ( $profile ) {
    return $this->show($propertyid);
}

return view('profile.create', [
    'propertyid' => $propertyid,
    'propertytype' => $propertytype
]);

manogi left a reply on How Do You Properly Check If A Record Exists?

You should have a look at the firstOrCreate/firstOrNew Eloquent methods - they make what you want to achieve much easier and nicer to read:

https://laravel.com/docs/5.7/eloquent#other-creation-methods

26 Sep
1 month ago

manogi left a reply on Laravel Form Request

I think @jorpedito meant "you can now remove this part from your controller".

25 Sep
1 month ago

manogi left a reply on Unit Testing Advice

At browser level (you probably mean Dusk) ist different. You will run into problems using RefreshDatabase, for example.

But Dusk is a great tool! I use it to make sure clicking buttons and filling forms etc. works the way it is supposed to. Also it is great to test stuff that has beed added to your site by JavaScript.

But will have to rely on certain DOM elements to exist and having specific classes, IDs or attributes - that is a specificity which should not matter in feature tests.

For testing routes I would stick to Feature Test (HTTP Tests) - it is much simpler, and in tests one should stick to the simplest possible way, I think.

The feature test should be

**"An authenticated User can call route('make/some/noise') and some noise should be made", **

That test should keep working, no matter how you structure your frontend code.

You can of course write a Browser test:

"Someone visits the login page, fills in the login form (targeted by ìnput[name=username]` etc), clicks the Submit button, lands on another page, clicks the Button "Make some noise"....

And so on, but that probably should be broken up into multiple smaller test methods. And in my opinion this should not replace the Feature test.

manogi left a reply on Laravel Query

So if your have 5 with the name "Tom" you want to show 2 in your result? I don't understand what you mean by "the unique one".

manogi left a reply on Unit Testing Advice

Your example falls more unter Feature Tests - it tests routes or http endpoints of your application. A Feature is (in my opinion) something your App DOES.

A Unit is a small (the "smallest"?) part of your app, which can be tested in "isolation". For example, if you have methods on your model Customer, you might (it is totally up to you) want to test each method separately in Tests\Unit\CustomerTest.

manogi left a reply on Unit Testing Advice

Instead of writing in detail how I would go about this I recommend watching the Unlocking Badges Workshop or Let's build a forum with TDD.

Jeffrey jumps between Feature and Unit tests. But when you start from zero, it makes sense to start with a feature of your app and write some feature tests. In the middle of those tests you might find the need to write a unit test and then go back to the feature test...

As for what is a feature test and what is a unit tests: Watching those videos will explain it much better than I can... a feature test tests features (duh!) of your app, for example "An Authenticated User Can Delete Customers". That would probably test a http endpoint used to delete Customers.

While writing said test ("An Authenticated User Can Delete Customers") you might find you want to write a test to make sure that deleting a Customer with the Eloquent method delete will not (or WILL, whatever is correct in your case) delete the Contacts which "belonged" to the deleted Customer. That would belong to the unit tests, in my book.

But Jeffrey explains it much better ;-)

12 Sep
2 months ago

manogi left a reply on Content Submitted Fail To Be Inserted Into Database

Please also show your Post model class.

manogi left a reply on Content Submitted Fail To Be Inserted Into Database

Which error do you get? And could you please edit the question, some of the code is not in the code area, it is hard to read?

manogi left a reply on Model Update Error

True @s4muel. @geetpurwar - what is the outcome when you add nullable| before the rules that are optional?

manogi left a reply on How To Display Encrypted Id In View?

Ah yes, the Session model, not the User model, thanks @Vilfago.

manogi left a reply on How To Display Encrypted Id In View?

Does {{ $user->getOriginal('id') }} maybe return the encrypted value?

manogi left a reply on How To Display Encrypted Id In View?

Do you have an accessor for the ID on your User model?

manogi left a reply on Model Update Error

I wrote nullable|min:2 because as I understand it all those fields need that modifier - I think only name is really required?

As for why the error message says "...at least 2 characters...": We would have to have a look if custom messages were added, or something along those lines. Using the default messages from Laravel it should say "...10 characters...".

manogi left a reply on Model Update Error

As far as I know the min rule will be triggered by empty fields (so the required on name is actually unnecessary).

You can add nullable before those fields if they are indeed sent empty, and sometimes if they are not even sent with the request.

In your case I thing nullable|min:2 would do the trick.

05 May
1 year ago

manogi left a reply on Query Strings Not Passing To Controller, Anything Based On _GET Not Working

Wait - my problem ist not exactly the same, as it seems NO GET parameters get throught at all. I tried catching them right on the first line of public/index.php (empty array, while it shows the parameters on my local machine).

manogi left a reply on Query Strings Not Passing To Controller, Anything Based On _GET Not Working

I have exactly the same problem on a Forge server (PHP 7.1) - did you find out what the error was?

16 Nov
1 year ago

manogi left a reply on Laravel Is A Giant Waste Of Time

Please don't forget that you can always ask things in the comment section.

When something went to quick for me or I don't get my head around something, I just ask in the comments. Either a more skilled dev than me or Jeffrey himself will usually answer pretty quickly.

And actually I'm glad that Jeffrey uses some shortcuts and tricks from time to time, because it makes me learn those tricks and get more efficient in coding myself. I'm talking about bash aliases (using "art" instead of "php artisan" for example), Sublime Text shortcuts and plugins etc. If he always stuck to refraining from his own shortcuts, I'd probably not have learned half as many myself. The same here: ask about it in the comments and it will be explained, most probably.

02 Nov
2 years ago

manogi left a reply on Vuex Todo App By Paul Adams

I think you should read through the docs - they are not too long and explain a lot to get startet with Vuex:

[Vuex Docs] (http://vuex.vuejs.org/en/index.html)

[Getters are explained here] (http://vuex.vuejs.org/en/getters.html)

"@change" is just the Vue shorthand for "v-on:change" [See here in the Vue docs] (https://vuejs.org/guide/syntax.html#v-on-Shorthand)

06 Jun
2 years ago

manogi left a reply on Subdomains With Laravel Valet

Yes! Thanks!

27 Apr
2 years ago

manogi left a reply on Troubles With Sparkpost

@stefr wow and yay - this works great for me! Thanks!

manogi left a reply on Troubles With Sparkpost

I use sparkpost as the mail driver under Laravel 5.2 and then the built in "Mail" API. But how come "subject" ist passed, but "campaign_id" is not?

manogi left a reply on Troubles With Sparkpost

Thanks @richeland.

The underlying package used in the Mail() class is SwiftMailer. I found a way to send headers with the message, but for some reason when I set the "subject" this way it works, but when I try to set "campaign_id" like this it does not seem to have an effect - maybe this is something to look at?

This works: ´´´ $swiftMessage = $message->getSwiftMessage(); $headers = $swiftMessage->getHeaders(); $headers->addTextHeader('subject', 'my custom subject...'); ´´´ "my custom subject..." appears as the subject when I looke at the "Message Events" in Sparkpost.

This does not work: ´´´ $headers->addTextHeader('campaign_id', 'my custom campaign name...'); ´´´ The campaign name won't show up in Sparkpost.

manogi left a reply on Passing Custom Parameters For SparkPost API Call

I have the same problem and so far only got halfway there - maybe you can go with this info:

I found a way to add headers, and Sparkpost will understand the "subject" header like so:

$swiftMessage = $message->getSwiftMessage();
$headers = $swiftMessage->getHeaders();
$headers->addTextHeader('subject', 'my custom subject...');

But trying to set the campaign_id the same way does not seem to have any effect:

$headers->addTextHeader('campaign_id', 'my custom campaign name...');

The campaign name won't show up in Sparkpost :-(

Maybe it helps a little....

manogi left a reply on Troubles With Sparkpost

I'm also interested i exactly these questions...

04 Apr
2 years ago

manogi left a reply on Saving An Intervention Image Instance Into Amazon S3

Wow - this mega helped me. Thanks!

14 Mar
2 years ago

manogi left a reply on Octobercms, Forge, Envoyer Workflows?

For anyone who's interested, here is my workflow for :

  • Having a working test website locally
  • Deploying to my production website via Forge (This is a simple setup, no staging server is used).
  1. make new empty repo in github

  2. clone repo to local system

  3. make new forge site:

  • remove "public" Web Directory
  • make site
  • uncheck "Install Composer Dependencies" repository
  • install repo
  • edit deploy script: remove 2 lines:

composer install --no-interaction --no-dev --prefer-dist
php artisan migrate --force
  • add line:
 
php artisan october:up
  1. download october installer on local system

  2. push to github

  3. deploy once in forge

  4. Install a site locally and install a site on your forge location ("from scratch")

  5. Delete install.php and /install_files locally and on your forge location

  6. change gitignore locally:


.DS_Store
*.log
/vendor
/storage
/plugins/october
/modules/**/*
/config
/bootstrap
/themes/demo
artisan
index.php
.htaccess
  1. Turn on Quick Deploy in Forge

  2. Start coding your custom themes and custom plugins locally and push to deploy whenevev you like.

Using gulp, bower etc:

I personally use sass, bower and gulp in my theme assets folder. If you'd like to do something similar, make sure to gitignore the source folders for your sass/css, and also you js (if you use gulp to combine your js files like me) and publish only your destination folders for css and js. I my case this looks like this in my gitignore file at root level - in your case of course things might differ, and of course you could use gitinore files in the respective folders (I just like to have everything in one place):


/themes/[your theme name]/assets/src
/themes/[your theme name]/assets/vendor
/themes/[your theme name]/assets/node_modules
/themes/[your theme name]/assets/.bowerrc
/themes/[your theme name]/assets/bower.json
/themes/[your theme name]/assets/gulpfile.js
/themes/[your theme name]/assets/package.json

Using third party PHP in your custom plugin:

I often need to include third party libraries that are not included in October CMS. This is how I do it: Locally I use composer in my plugin folder to install the libaries. Then I make sure composer.json and composer.lock are gitignored:


/plugins/[your author name]/[your plugin name]/composer.json
/plugins/[your author name]/[your plugin name]/composer.lock

Everytime push to deploy, the third party libraries are also pushed.

Of course this is just one way of doing it - and when I work on a Laravel app without October CMS I would not do it this way, but instead gignore my vendor file and publish my composer.lock file and let composer on the production server install the dependencies, but when working with October I found it easier to not have running composer on the production server.

Hope this helps someone.

15 Jan
2 years ago

manogi left a reply on Failed Deployment Of Non Laravel Project

Hi everyone, yes I have on simple PHP-Site that also has the two lines (composer and artisan) again that I either commented out or removed - I don't remember which:

cd /home/forge/sechs-dinge.de
git pull origin master
composer install --no-interaction --no-dev --prefer-dist
php artisan migrate --force

No big deal though - I just mention it since you asked.

24 Sep
3 years ago

manogi left a reply on Cache Tags Removed In L5 ?

It's also back in the docs since a few weeks now.