Author: bandel

  • Top 8 Free and Paid Resources for Learning Laravel

    Introduction

    No matter if you’re brand new to Laravel or have been using it for years, there’s always something new to learn. The framework and its ecosystem are constantly evolving and growing to improve the overall developer experience. So, it can be quite important to keep up to date with the latest changes so that you don’t fall behind.

    It’s also likely that you’ve run into a coding problem once or twice and needed to reach out to people online for a bit of advice and help. Let’s be honest, as developers we spend quite a lot of time searching online on a daily basis looking things up. Whether it be to jog our memory on a certain algorithm or to look at possible ways of tackling new pieces of code.

    The list below shows you 8 different places you can go online to give help you learn Laravel, keep up to date with it and also ask community members questions:

    Laracasts (Free and Paid)

    Laracasts is an online platform that has over 1700 lessons that you can use to learn about Laravel and other web programming related topics. The great thing about Laracasts is that it doesn’t focus solely on Laravel; it also has lessons based around tooling, testing and different programming languages. For example, there is a series of lessons based around getting your IDE (integrated development environment) or text editor, such as PHPStorm or Visual Studio Code, set up to make your development experience more productive.

    At the time of writing this article, some of the lessons on Laracasts are free and you can view them without having to spend any money at all! However, I would strongly recommend signing up for a paid account, which is $15/month, so that you can get full access to all of the tutorials.

    Another great thing about the Laracasts are it’s forums and the helpful community. If you ever have any questions or an issue that you can’t figure out, you can post it on to the forum. A large majority of the time, someone will reply to you with an answer that helps you solve your problem.

    Laravel News (Free)

    Laravel News is the official Laravel news source. They post new articles, tutorials and tips on a daily-basis as well as provide a newsletter that is sent out regularly. These articles always have useful information about different topics or new Laravel packages that you can use within your code.

    Although Laravel News doesn’t have a forum like Laracasts, the newsletter and podcast that they provide are extremely beneficial at keeping you up to date with the latest goings-on in the Laravel space.

    As a side note, I’ve actually had two of my Laravel packages that I’ve built in the past (Laravel Exchange Rates and Laravel Executor) featured on the Laravel News website. If you’d like to check them out, the articles were: Laravel Exchange Rates API Package and Simplify Installing and Updating your App With Laravel Executor.

    Laravel Documentation (Free)

    One of the most useful resources for helping you learn how to use Laravel is the official Laravel documentation. The documentation is really detailed and covers a large amount of the framework that you would touch when working on projects.

    Typically, huge amounts of documentation can feel overwhelming and can feel like being bombarded with too much information at once. However, I personally feel like the Laravel documentation does a really good job of splitting things out and making it easy to understand. Even after working with Laravel for years, I still always have the documentation open in a tab in my web browser just in case I need to quickly brush up on a topic.

    Top tip: For any of you that use DuckDuckGo as your search engine, you can search for “!laravel” and it will take you straight to the Laravel documentation.

    Udemy (Paid)

    Udemy is a video platform that’s similar to Laracasts. It sells online video courses that you can use to learn about a range of topics. However, they have a section that is dedicated to Laravel and learning how to use it; ranging from beginner to advanced courses.

    I’ve never personally used Udemy myself, but I know other developers that I work with that swear by it and find it extremely useful.

    Stack Overflow (Free)

    If you’ve ever done any type of software or web development, chances are you, you probably visit Stack Overflow on a daily basis. But if you’re just starting out as a developer, you might not have heard of it yet.

    Stack Overflow is an online question-and-answer site for developers. As an example, say if you have a question about something or have a bug in your code, you could post your question on Stack Overflow and someone would try and answer it for you. However, the chances are that if you’ve got a problem, someone else has already had it, posted the question and got an answer that solved their issue. So, Stack Overflow can be a great resource that contains almost instant answers for any problems that you might run into.

    If you need to ask a question though because it doesn’t already exist there, the community is usually really quick at answering.

    GitHub (Free)

    This resource is slightly different to some of the others above and might be a little more suitable for more experienced developers rather than any novices. There are countless Laravel projects and packages that you can find on public GitHub repositories. So, this means that there are a lot of places that you can look at to get ideas for development.

    As an example, when I first started writing Laravel packages, I wasn’t too sure on where to start. So, after reading through the Laravel documentation, I also checked out how other packages had been written. I looked at some of the official Laravel packages, such as Telescope, and also looked at how some of the Spatie packages were written. Being able to look at real-life examples of code can sometimes be more valuable than just looking at documentation that explains something. It gives you an insight and context into how things are actually done in practice.

    As a small side note as well, once you feel that you have enough experience with Laravel, you could maybe start contributing to open-source projects. This can be a little bit daunting at first but can feel extremely rewarding when your first pull request is accepted. When you make your pull request, the maintainers of the project will review your changes and additions to check that they’re okay to pull in. It’s usually during this stage that you get feedback on any changes you might need to make to get the pull request approved and merged. This feedback can really help you grow as a developer.

    Reddit (Free)

    Reddit is one of my personal favorite resources for keeping up to date with the latest Laravel and PHP topics. The r/laravel and r/php subreddits are made up of large communities of developers who can answer questions that you might have.

    I have asked questions on Reddit many times in the past for suggestions on how to tackle issues and have always been able to find an answer. The r/laravel subreddit also has a weekly “No Stupid Questions” thread that you can use to comment on and ask questions. Just remember though, if you’re asking any questions in any of the subreddits that you follow their rules; otherwise your post will get deleted.

    If you don’t want to post anything or ask any questions, the two subreddits can also be really helpful for keeping up to date with the latest news on the ecosystem.

    Other Laravel Developers (Free and Paid)

    One resource for learning Laravel that developers often overlook is possibly one of the most valuable… other developers. Sometimes, it can be really easy to sit and stare at a problem for a few hours without getting anywhere with it. Usually when this happens, it can be best to get an opinion from someone else who is looking at the problem from a different perspective. For this reason, it can be really useful to have other developers as friends or as someone you can contact.

    If you only have a quick question, quite a lot of developers will probably be happy to help you out and lend a helping hand (I know I would!). But, obviously, you have to remember that other people also have things they need to do and won’t want to be spending too much time helping you out for free. So, if you do contact a developer for help, try not to do it too often as it might discourage them from wanting to help you.

    Sometimes, you might also want to pay a more experienced developer to have a chat for an hour or two to go over some topics. Like I mentioned earlier, looking at documentation can give you an idea of how something is done, but speaking to someone can help you understand the “why”. Speaking to senior developers can be extremely helpful because it’s likely that if you run into a problem that they’ve already experienced something similar themselves and know any pitfalls that you should to try to avoid.

    If you have any questions about anything Laravel related or need any Laravel web development doing, you can always feel free to contact me and have a chat.

    Originally published at https://ashallendesign.co.uk.

    Source: https://ashallendesign-uk.medium.com/top-8-free-and-paid-resources-for-learning-laravel-4927b0174cab

  • What Is Laravel Jetstream And Why Is Every Laravel Development Company Talking About It

    Laravel is an open-source PHP framework and it keeps adopting new versions to perform on various projects. After Laravel 7.27.0, Laravel 8 projects are going to float over the internet. Here is a brand new Scaffolding package for Laravel 8 projects that are named ‘Laravel Jetstream’ for every Laravel development company to use. Laravel Jetstream is an open-source package derived by the Laravel team. This free package goes beyond Authentication Scaffolding.

    Now, Laravel Installer includes support for Jetstream. The latest Laravel version 8 is coming into existence with a new feature Laravel Jetstream to set it with better improvements. This enhances the Laravel development services by performing in the changed package of Laravel/UI.
    With the latest version, Laravel is moving ahead from the jQuery and Bootstrap based scaffolding. Laravel was stuck to these scaffolding and the change was indeed needed. Laravel Jetstream is the one that not only brings the change but also gives a more intuitive way of development to Laravel developers.

    The Change Cum Revolution with Laravel

    • Laravel Mix helps to compile SASS files to plain CSS. The ‘package.json’ of Laravel includes the ‘bootstrap’ package after installing the ‘laravel/ui’ composer package. It further generates the frontend scaffolding. Now, on the other hand, Laravel Jetstream has changed the things from Laravel/UI package. Tailwind has taken the place for CSS. Tailwind CSS is a low-level CSS framework, which is highly customizable too.
    • Developers use ‘Presets’ to handle frontend. They allow developers for adding additional methods to the ‘UiCommand’ class at runtime. Presets are ‘macroable’ that needs to be declared in a service provider. Laravel Jetstream includes ‘Inertia.js’ or ‘Livewire’ to replace presets in Laravel/UI.

    Tailwind

    Tailwind is a highly customizable and utility-first CSS framework. It helps to build rapid custom designs. Tailwind serves the developers with bespoke designs where they need not to worry much about those annoying opinionated styles.

    Most CSS frameworks perform too much with all sorts of predesigned components. They often create a mess with cards, buttons, and alerts, etc. When a business looks to hire Laravel developer, it needs to make sure whether the team can perform with customer design or not. But Tailwind is so different and easy to optimize. It provides low-level utility classes and replaces the opinionated pre-designed components.

    Tailwind drives custom designs without ever leaving HTML. This is completely your thing if you are just fed up with battling specificity wars, overriding unwanted styles, etc. Listing a few features of Tailwind that are contributing to making it different –

    Livewire

    Livewire is a full-stack framework that helps the developer for building dynamic interfaces. Every business looks for modern app development. This development becomes much hard with tools like Reach and Vue. Though these tools and extremely powerful, the complexity causes fatigue.

    Livewire comes with the comfort of Laravel. If you will into its codes, you can find out the difference and uniqueness of performance. It keeps improving with the real-time search component that the user sees after typing into the search input.

    It works swiftly and the performance is here –

    • SEO friendly performance with the page
    • AJAX request to the server at an interaction
    • Mutates DOM as the things changed

    Inertia.js

    Developers can build single-page apps with Inertia.js. There is no such requirement of building an API as Interia.js lets you build modern single-page apps with React, Vue, and Svelte. A Laravel development company uses classic server-side routing and controllers to perform the required task.

    First of all, Inertia.js is not a framework. This is completely a new approach, also known as a modern monolith. It neither has client-side routing nor requires an API. Inertia performs by leveraging existing server-side frameworks. Developers can simply build controllers and page views.

    There are three official client-side adapters where the developers actually perform. These are Vue.js, React, and Svelte. Additionally, two server-side adapters are also here Laravel and Rails. Inertia is designated to work with existing client-side and server-side frameworks. Inertia comes with Vue.js as a default adapter.

    Availability of Laravel Jetstream

    Laravel keeps evolving with its various versions. These versions are coming with some revolutionary changes, every time. Laravel team brings major changes with its every version. They keep a 6-month interval between their two Laravel versions’ releases. Laravel 8 Non-LTS is a general version that provides six-months bug fixes and one-year security-fixes. WebOccult keeps itself informed and equipped with every technological development in the relevant realm.

    Since the latest version of Laravel is Laravel 8, the expectations for Laravel Jetstream also revolve around that date. 8th September 2020 is the date when Laravel 8 is coming out with some supreme features. Laravel Jetstream can also follow it after the arrival or one/two weak later. Thus, it is just nothing to hire a Laravel developer. A business must ensure that the developer (or development team) is well-aware of every latest technology and versions before hiring them.

    Features of Laravel Jetstream

    Laravel Jetstream offers amazing scaffolding for Laravel applications. It is a new Laravel ecosystem. This open-source platform is completely free for developers. Laravel Jetstream includes much cool and development-friendly stuff. A few of its useful features are mentioned below –

    User Profile Management

    User Profile Management is, somehow, the key feature of Laravel Jetstream that sets it different from others. Here, the user can update various relevant information, easily. It includes information like –

    • Users can update a profile picture.
    • Users can update their name, along with email and password.
    • Users can view the Browser Sessions and log out from there.
    • Users can delete their account, completely.
    • Developers enjoy full control as all functionality and its code is available to them.
    • Two Factor Authentications is available with Recovery codes and QR code.

    Team Management

    Though it has been very usual that developers do use the ‘teams’ feature in every SAAS application, Laravel Jetstream has clubbed it in a very unique as well as a better way. It adds ‘teams’ entry in the ‘jetstream.php’ config file with to enable you to –

    API Tokens

    This is an ultimate feature of Laravel jetstream where it uses Laravel Sanctum to generate API tokens, under-the-hood. A Laravel developer can perform by adding a single line of code in the ‘jetstream.php’ config file to enable the user form generating their own tokens. Even if it is not required, if your Laravel app exposes an API, the developer should give this flexibility to its users.

    With the suggested configuration, a new page will be added automatically, namely, user/api-tokens. Additionally, the user can also manage token permissions on this page, which are defined in ‘JetstreamServiceProvider’.

    Final words

    Laravel 8 is going to give a kick to Laravel development. Laravel Jetstream is like a non-billing part of Laravel Spark that is offered by the Laravel team. Since the intuitive and futuristic approach of the team is unquestionable, Laravel Jetstream can add much more to the Laravel development. We, at WebOccult Technologies, provide unerring Laravel development services to the clients where we keep adopting every new trend of the technology.

    All we can say is that Laravel Jetstream will work effectively. It looks quite appealing and promising in the first look, let’s see how far it walks with us!

    Originally published at https://www.weboccult.com.

    Source: https://mahipal-weboccult.medium.com/what-is-laravel-jetstream-and-why-is-every-laravel-development-company-talking-about-it-a0635d43d572

  • Getting Started with Redis As A PHP (Laravel) Guy Or Girl

    What is Redis?

    Redis which stands for Remote Dictionary Server is an open-source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker.

    In basic words, Redis is a Key-Value Store that stores data in Key-Value pairs.

    For Example:

    How data is stored in Redis

    Redis is a No-SQL database.

    Basically, this means it does not have tables, rows, columns, functions, procedures, etc like in MySQL, Oracle DBs

    It also does not use SELECT, INSERT, UPDATE, DELETE.

    Instead, it uses data structures to store data.

    Like,

    • String
    • Lists
    • Sorted Sets
    • Hashes
    • Sets

    And,

    • Bitmaps (also called bit arrays, bit vectors, etc.)
    • Hyperloglogs ( It’s is a probabilistic data structure used to count unique values — or as it’s referred to in mathematics: calculating the cardinality of a set)
    • Geospatial Indexes (The geospatial index supports containment and intersection queries for various geometric 2D shapes.)

    Interaction with data in Redis is command based.

    One of the key differences between Redis and other key-value databases is Redis’s ability to store and manipulate high-level data types.

    Redis is a popular choice for caching, session management, gaming, leader boards, real-time analytics, geospatial, ride-hailing, chat/messaging, media streaming, and pub/sub-apps.

    To learn more about Redis you can visit their website, redis.io.

    Getting Started

    For this post, I’ll be working with Ubuntu 18.04 but any Linux Distro works.

    You’ll need PHP (Laravel) installed, Follow the instructions here to get it installed https://panjeh.medium.com/install-laravel-on-ubuntu-18-04-with-apache-mysql-php7-lamp-stack-5512bb93ab3f;

    For test purposes, You’ll also need Redis installed locally.

    To do this simply run,

    sudo apt-get update

    Then,

    sudo apt-get install redis-server

    Finally;

    sudo systemctl enable redis-server.service

    One more thing,

    sudo nano /etc/redis/redis.conf

    Optionally, you can increase or decrease the memory limit is available on your host machine.

    maxmemory 256mb
    maxmemory-policy allkeys-lru

    Then finally restart your Redis server.

    sudo systemctl restart redis-server.service

    and start it up by running

    redis-server

    By default, it runs on host: 127.0.0.1 and port: 6379.

    Finally, Getting Started

    We’ll be using a test project for our example.

    • So open up your terminal with CTRL+ALT+T, and type in the command below in the directory of your choice;
    composer create-project — prefer-dist laravel/laravel redis-example
    • Navigate to the folder
    cd redis-example

    Install the predis/predis package via Composer

    composer require predis/predis

    Configuration

    The Redis configuration for your application can be found in config/database.php. In this file, you’ll find a Redis array containing the Redis servers utilized by your application.

    'redis' => [
        'client' => env('REDIS_CLIENT', 'predis'),
    
        'default' => [
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_DB', 0),
        ],
    
        'cache' => [
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_CACHE_DB', 1),
        ],
    ],

    The default configuration uses phpredis as it’s client, so you’ll have to change this to predis if you’ll be using the laravel predis package.

    Interacting with Redis

    You can interact with Redis by calling various methods on the Redis facade.

    Redis facade supports dynamic methods, basically, this means that you could call any command on the facade and the command will be passed directly to Redis.

    Here’s an example,

    namespace App\Http\Controllers;
    
    use App\Http\Controllers\Controller;
    use Illuminate\Support\Facades\Redis;
    
    class UserController extends Controller
    {
        /**
         * Show the profile for the given user.
         *
         * @param int $id
         * @return Response
         */
        public function showProfile($id)
        {
            Redis::set('name', 'Taylor');
            $values = Redis::lrange('names', 5, 10);
            $name = Redis::get(‘name’.$id);
            // $values = Redis::command('lrange', ['name', 5, 10]);
            $user = [
                'name' => $name,
                'values' => $values
            ];
    
            return view(‘user.profile’, [‘user’ => $user]);
        }
    }

    For more commands like this, you can check out the laravel documentation on Redis here

    Source: https://olat-nji.medium.com/getting-started-with-redis-as-a-php-laravel-guy-or-girl-6a8d875a4166