Posts with laravel Tag

My very first blog post!

Actually it's not, I had to make other posts to test it with first. This blog serves as a way for me to document the struggles I've come across in new programming languages and examples so that other developers or new developers can also learn fro...

Read more

Slugs for URLs tutorial

For those wondering how one can change the default 'id' endpoint URL format to a slug look no further. What this post will be going over is removing the 'id' in the URL with a user friendly URL (SEO friendly) from scratch but I will be skipping over...

Read more

Simple feedback form

Today we'll make a feedback form so users can contact you. It's not too difficult and it'll involve the use of setting up a new route, using the Mail class, forms, configuring the settings for our mail server and using the blade templating engine to...

Read more

Getting Your Tweets Twitter For Laravel Tutorial Part 1

It seems the majority of Twitter tutorials for Laravel (in particular) focus on logging the user in, adding their credentials to the database and then posting tweets to the user account. We’re going to skip the majority of that because I know you don...

Read more

Twitter For Laravel Part 2

Following on from Part 1, in this short tutorial we’ll post tweets to your account and also add hashtags. I won’t be going over how to retrieve hashtags from the blog, that is something that won’t be covered in this tutorial but you can always grab w...

Read more

Artisan Tinker With Laravel

A neat tool to literally tinker/interact with your website. It's new to me at the moment but I currently use it to test relationships between models and fiddle with the database. To use Tinker, bring up the command line interface and we'll move to...

Read more

Redirection On Login

If we’d like to provide an admin area and a standard user area, this can be done in the file Auth/LoginController.php in the function authenticated() which you must include yourself, to override the method

	
    protected function aut...

Read more

AJAX Errors - Success but failure

Spending time on errors are extremely time consuming. I’m not sure what the best ways are to speed this up but some ways are to check the basics and read the errors. Sometimes it’s like stepping in the shoes of Sherlock Holmes but usually most of the...

Read more

SQL Raw Queries In Laravel

Learn to love it. I find it much more concise than using the Eloquent that helpers and Query Builder that have been provided. Eloquent is definitely great and easy to use but I feel I don't need another syntax I need to follow as SQL queries are m...

Read more

CSRF Token

A short blog post but I’ve also realised that the CSRF token isn’t required to be within a form. It can be placed within your tags. Generally I think in future cases I won’t add additional token tags as they do produce the same token despite h...

Read more

Event and Queue Debugging

Coming back to the event that sends emails for a personal project, it came to the point to re-test the event and expectedly it didn’t work. It’s harder to find the issue with queues as they don’t print the stack trace in the browser, as it runs in th...

Read more

Creating registration emails upon registration


    protected function create(array $data)
    {
        //create confirmation code
        $confirmation_code = str_random(30);

        //main bulk of user creation
        $user = User::create([
            'first_name' => $d...

Read more

Authorisation/Authentication features in Laravel Part 1 - Gates/Policies

Gates, Policies, Guards and Middleware. When you first use them, they all seem very similar. But in fact each have a use for a specific area of authorisation and settings rules throughout your website. If you’re new or confused with Laravel’s auth...

Read more

Authorisation/Authentication features in Laravel Part 2 - Guards

Guards define how the application retrieves and sends information about the user; whether it’d be by the class method of cookies or api tokens. Guards are slightly more technical but using guards allows us to have multiple authentication. So imagine...

Read more

Authorisation/Authentication features in Laravel Part 3 - Middleware

Think of it as rules for a single or many routes; it is also possible to group an assortment of routes, mainly to keep the code much more readable. Their use is to direct users from entering pages or areas of a website, somewhat like directing traffi...

Read more

Vuejs - data: or data()?

Do you get an undefined value when printing the data from a component? Spent a few hours debugging this on a codepen I’m working on for my portfolio. As I’m passing an array to a child component I was outputting an undefined array for the child’s pro...

Read more