Custom Input Components

You’ll surely come across instances in your own projects, where you’d like to wrap a form input within a custom component. This way, you can have a single place to attach all custom sanitization, validation, and behavior. However, in the process, you’ll also find that the useful v-model directive no longer works the way it usually does.

In this episode, we’ll learn exactly what Vue’s v-model does, and then review how to make it work on any custom component. View the demo for this lesson on GitHub.
Source: Laracasts

Laravel Auth Redirection

When you use Laravel’s built-in Auth system, it provides a redirectTo property on the LoginController, RegisterController, and ResetPasswordController. This property allows you to define the location you want your users sent to after they complete the action.

Inside of Laravel this is setup and implemented through a RedirectsUsers trait and a minor improvement has been added to this that will now allow you to define a redirectTo method with a fallback to the property.

public function redirectPath()
{
    if (method_exists($this, 'redirectTo')) {
        return $this->redirectTo();
    }

    return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';
}

With this new method, you now have easier access to perform other actions or to set the location dynamically. As an example, let’s pretend when a user logs in you want to redirect them to their public account page. Inside your LoginController you can now do something like this:

public function redirectTo()
{
    return '/@'.auth()->user()->username;
}

Source: Laravel News

Seven Tips to Learn Laravel More Effectively

As the community grows, there are many resources available to help you learn Laravel. That’s great! But, how do you choose the best one? Which will be the best use of your time to read or watch? For those new to the framework, I’m sure these questions are on your mind, here are seven tips to help you learn Laravel more effectively.

Some of these tips will be specific to Laravel, while others are more general for learning any programming language or framework. Let’s get started.

1. Don’t Start With the Official Documentation. Seriously.

The first thing newcomers typically look at is the official Laravel documentation. Don’t get me wrong—the docs are great! But, there’s an expectation you already have some knowledge of the PHP ecosystem and modern tooling.

As an example, the first section of the documentation is installation, it’s not just “Download and install.” You need to know how to use Composer; how to use the terminal or command line, how to run commands, how web servers work etc. Which leads me to the second tip…

2. Learn PHP, OOP, Terminal, and Composer First.

It might sound funny, but I see more and more people trying to learn Laravel without learning PHP first. Another similar trend is those who try to use jQuery without learning any JavaScript. Stop fooling yourselves and start with fundamentals.

To begin learning any modern PHP framework (Laravel, Symfony, or others), you need to be good at PHP. And, especially, object-oriented programming; all frameworks are written in OOP mode and you need to be fluent in classes, objects, properties, methods, dependencies, traits, and other “keywords.”

In general, I would advise you to create at least one simple project with plain PHP without any framework. You will then have a better understanding of PHP which will allow you to use the Laravel internal functions more efficiently.

Also, Composer,  a tool that, in my opinion, made PHP great again. Knowledge of Composer will help you competently use Laravel dependencies, which is a crucial part of modern PHP development.

Oh, and did I mention terminal? Or command line for Windows OS. Again, modern PHP frameworks use commands for a lot of their functionality—generating code, installing libraries, changing settings, running deployments, etc. You have to know the basics.

All of this is how much you need to know BEFORE starting with Laravel. It doesn’t look as easy anymore, does it? But let’s move on; we’re just getting started with tips.

3. Books, Courses, or Videos? Free or Premium?

This is probably the most important question: what is the best way to learn? It’s a personal choice; some people are better readers, while others prefer videos. And that’s fine! Ask yourself, what is more convenient for you?

The information you want to consume should be properly structured. You cannot just take random articles or videos from YouTube—it won’t give you the desired result. You need the author to explain the information in a consistent flow, step-by-step. Otherwise, you may lose your train of thought and not be able to understand further lessons.

That is, by the way, the fundamental difference between free and premium lessons online. Some  say you can learn to program just from searching the internet because there’s a huge amount of information available for free. Which is partly true, but if you choose that path, you will have to spend a lot of time trying to piece it all together. Paid courses or books are often the best because the information is prepared for you in a convenient way, so you don’t waste your time searching.

Here are three resources that I recommend to start with:

4. Stop Reading, Start Writing

It is impossible to learn any programming without writing code. Don’t spend too much time reading books or watching videos; start coding as early as you can. In fact, after finishing every lesson or section, immediately try it in practice.

In general, I would advise you to try creating a test project during the course of learning. It makes the process not only more realistic, but more motivating. Without a proper goal and outcome in mind, it’s emotionally hard to continue learning the theory.

And, if you only write code, you will bump into hurdles and will have questions to ask. By having problems and overcoming them, you evolve as a developer and increase your knowledge.

5. Learn to Use Google and StackOverflow.

While not directly related to Laravel, it is important. It astonishes me how many forum topics are created by people who could Google the answer in two minutes.

Can you properly use Google? Example: search for “Laravel,” excluding the word “beginners” but include only results from the Laracasts website? The query should look like this:

laravel -beginners site:laracasts.com

That’s how deep you should go to find relevant information.

StackOverflow should be used similarly. Their results usually appear among the first Google entries. Do you understand how to choose the right answer to the question? It’s not always the first one. Can you tell which Laravel version it’s for? Is it still relevant information?

It’s not only about reading the forums; you should be able to ask questions in a correct way and style. Usually, every forum and community has its own culture, rules, and behavior expectations. If you are polite, patient, and respectful, you have better chances of receiving help.

6. Find a Mentor.

The biggest problem with learning programming is troubleshooting when something doesn’t work. The best solution to this problem is asking someone else for help.

I’ve been a mentor for a few students and was told without my help they wouldn’t be able to solve problems and potentially would have even given up learning. That’s how powerful personal, external help is!

Where should you look for a mentor? In your community, whether it’s local or online. Twitter has a great community of developers, so if you find someone there who seems like they can help—don’t be shy and get in contact. Mention them on Twitter, follow for a while, find their email, and start the conversation.

7. Don’t. Give. Up.

As mentioned in the previous tip, when hitting a problem you can’t solve, it’s easy to give up on learning. Maybe that’s the very reason why so many start learning, but only a few actually become professional developers. It’s not all rainbows and butterflies; the path will be full of problems, difficult questions, disbelief, and desire to throw the computer out of the window. I’ve been there, trust me. The main thing is to continue, no matter what. Be creative; there’s always a way out.

Finally, speaking of continuous progress, my last advice is to not take long breaks between your learning sessions. Constantly learn something new—every week or even every day. It’s similar to working out; if you miss one day, it’s harder to get back into the rhythm.

So these are my tips—I hope you will find your best way to learn and potentially we’ll create awesome Laravel projects together!

Source: Laravel News

Bear: Beautiful Note Taking App for iPhone, iPad and Mac

I am a fiddly writer. I store all of my written prose as text files in Dropbox. Not only are my writings saved for many future generations, but I am not locked into any particular writing ecosystem. I can switch between various writing apps (which happens often) with ease. Hopefully, these small details on how I personally approach an app like Bear is useful to you when you need to decide if it’s worth believing me. Now, onward.

You can’t move your mouse in the Mac App Store without hitting a distraction-free writing app. I originally thought that’s what I was getting with Bear. I was wrong.

When you first click on it’s playfully subtle red and white icon, you see a simple app that looks incredible. When you first tap out a short note in Bear is when you realize this app isn’t just well designed, It’s handcrafted software everyone can use.

Bear is simple but surprisingly deep. For instance, Bear has it’s own writing syntax that is similar but not exactly the same as John Gruber’s Markdown. I found this peculiar at first but after poking around in the settings I found that Bear contains an option that will force it to abide by the Markdown syntax instead.

Bear contains just enough features to get a fiddly writer like myself ready to go. One of my favorite features is the ability to link to other notes within the app with ease. This makes it possible to do all sorts of things, from stringing together a series of notes about various projects all the way up to writing a book.

There’s also a simple but surprisingly extendable tags systems that makes it easy to organize all kinds of writings. You can put all of your written words into Bear without the fear of losing them.

The most impressive thing about Bear isn’t even a feature at all. It’s the pricing structure. It’s free to download on Mac and iOS. You can get syncing if you subscribe to Bear Pro which is $1.49 per month or $14.99 per year. This is one of the most affordable subscriptions I’ve seen for an application of this caliber. I am very impressed the developers have launched Bear in this way.

If you like fussy coffee, quality leather shoes, or a handmade desk, then you’ll like Bear. It’s handcrafted software that anyone can use.

Source: Laravel News

Laravel Scheduler Adds Support for Running Hourly Tasks on a Certain Minute

The Laravel Scheduler now includes a new method hourlyAt that will allow you to define the minute within the hour that it should run. This helpful in situations where you have a task that should run hourly but not at the top of the hour.

Using the same simple syntax as all the other methods and here is a quick example:

$schedule->command('mytask')->hourlyAt(15);

This will set the command to run every hour on the 15th minute. Of course, you can still pair it with the other methods to get more fine-grained control:

$schedule->command('mytask')
    ->weekdays()
    ->hourlyAt(15);

This feature is included starting at v5.3.29 and will allow you to use the familiar syntax instead of having to jump into using the cron method to define it.

Source: Laravel News

Shared State 101

Let’s begin reviewing shared state. You’ll absolutely run into this before too long. If you have multiple Vue instances or components that need access to the same data – and they also need to be in sync with one another – how exactly do we allow for that?
Source: Laracasts

Finding Suitable Work: What Hiring Managers Are Looking For

A large component to finding suitable work is being a proficient interviewer. One of the things many devs lean on when landing a better paying job is their ability to do well during the technical interview. They put so much emphasis on the code and think it’ll be all they need to secure that next opportunity. However, nailing the technical interview is only the first component of finding suitable work as a developer. To be qualified for most higher-level positions in tech, you need to be well-rounded.

What do I mean by that? Working for a company is more than just coding. Whether you’re helping build something from the ground up; maintaining an established product; or stepping away from code to focus on strategy, hiring managers need to know you can truly handle all of the aspects of the job. They need to see you are capable of communicating effectively and working well with your coworkers. Beyond that, they need to be fairly certain you aren’t going to make their lives harder.

Here’s what we know about managers. First, they need to be good motivators; great managers know how to engage their employees to get the most out of them. To this end, they need to build solid relationships with each of their team members while also holding those individuals accountable. In short, a manager’s job is twofold: to complete their technical tasks and ensure their team members are completing theirs as well. That’s why when managers are looking to fill out their staffs, they want people who know the value of putting the team over the individual.

We are living in a world which is increasingly more connected. The internet and ever-advancing technology has given companies the chance to truly sell anywhere. Huge, well-funded companies have always had access to the world beyond their city or state. But now, local mom-and-pop shops can put their products on sites like Etsy and go global. They can do it in the time it takes to fill out a profile and upload a few pictures. What this means is most of the work we do, we cannot do alone. We need to be collaborators.

And that’s why great managers are looking for people that value making their team successful. They know team success trumps individual success every time. Take the example above of the small local company going global via Etsy. Etsy is created and maintained by a team, just like the small artisan selling their wares online. Even if they are solopreneurs, they had help along the way from people that believed in them. Those people helped by asking questions about what was needed and how they could assist.

Do you see the pattern? Teams of people can achieve more than individuals can by themselves. No one becomes successful alone; and for that reason, we are truly all collaborators. And to be good collaborators, we need to be good communicators.

When looking to add a few more people, great managers value strong communication skills. I can’t tell you how many times I’ve heard this sentence: “They were a great developer, but I couldn’t hire them because there’s no way they I could put them in front of a client.” It’s no longer enough just to be smart; being innovative and having good ideas are great traits. However, if you can’t communicate those ideas, all of those wonderful qualities are worthless. There is indeed a time and a place for hacking away in a corner; situational solitude can result in a significant push when necessary. A lot of the time, though, you’re going to have to talk to people.

This is the reason communication matters even more than talent. Conflicts will arise. Differences in opinion can escalate to full-blown arguments. Brainstorming sessions need to take place. Presentations occasionally happen. Having a good command of code will only get you so far; you need to be a solid communicator. When you have command of that, collaboration will become a lot easier.

I’ve talked about a lot of big picture concepts and examples, so let’s relate this back to getting hired on a great team. Good collaborators propel projects forward. They do this by knowing their strengths and how those strengths relate to their place on their team. You can show this in an interview by highlighting your ability to work well with others. Maybe you played an integral and specific role on a big project recently; tell them how you articulated your role to your team and what you accomplished.

Good communicators speak eloquently to their team members and managers, and they tackle problems head on through empathetic communication. Showcase this in your next interview by describing a time you were involved in a conflict at work and how you handled it successfully.

Bottom line, hiring managers are looking for people that play well with others, communicate effectively, and can do the technical aspects of their job well.

Source: Laravel News

Laravel Powered Blogging App Canvas Launches V3

Canvas, the minimal blogging app built on Laravel has just launched V3, and it includes many new features including moving the core code out into a new Easel package. Here are some highlights of the other new features.

New Installation Wizard

When you create your first Canvas site, you are greeted with a friendly welcome message with instructions on starting the installation through the Artisan command, php artisan canvas:install

After going through the six steps, your new blog is ready to go.

New Media Manager

New in v3 is a media manager that is built on Vue.js and allows you to upload images and put them in separate folders. This can be accessed through the editor toolbar or from the sidebar.

Split Pane Markdown Editing

Canvas supports writing your blog posts in Markdown and uses the SimpleMDE editor that includes a toolbar for common commands, as well as a split pane preview so you can preview in real time.

Even More, New Features

Also in V3, Canvas now includes an update wizard, syntax highlighting, a light and dark theme, and role-based user management.

If you are looking to start a blog this year, Canvas would be a good choice.

Source: Laravel News

Not Secure Warnings are Coming to Chrome 56 – Add an SSL to prevent it

Chrome announced back in September that they want to move towards a more secure web, and one they plan to accomplish this is by marking HTTP pages that collect passwords or credit cards as non-secure.

Chrome 56 will be the first version that includes this change and it’s due out this month. Now is the time to upgrade your site to HTTPS if it isn’t already. Chrome is currently the most popular browser with 56% market share, based on netmarketshare, and this change will affect any site that has password registration and of course that accept credit cards.

If you need help adding an SSL there are many options available today to make it easier than ever before:

  • Let’s Encrypt – Free, automated, and open Certificate Authority
  • Cloudflare – Free plan with shared SSL and added DDOS protection.
  • Laravel Forge – Starting at $15 a month and works with DigitalOcean, Linode, & AWS and includes automatic support for Let’s Encrypt.
  • NameCheap – SSL Certificates starting at $9 a year.

To test out your sites before Chrome 56 ships you can open up the hidden Chrome flags preferences and change this setting manually and restart.

To get to this setting page just open Chrome and visit this URL: chrome://flags/#mark-non-secure-as

Source: Laravel News

This is Laravel Mix

One issue, with any build tool, is that for each new project, you have to reproduce the entire setup again and again. Wouldn’t it be useful if we could optimize for the 80% of folks who simply want general ES2015 + module compilation, some CSS preprocessing, and possibly a few other common tasks? And for the remaining 20%, well, they should have access to the underlying configuration file, so that they may tweak it to their project’s exact needs. Well, that’s exactly what Laravel Mix does for you.
Source: Laracasts

1 2 3 46