Connect with us

PhpStorm 2019.1 Provides Blade Debugging Support and a Laravel Code Style Preset

kizinho

Published

on

Follow
NEWS: PhpStorm 2019.1 Provides Blade Debugging Support and a Laravel Code Style Preset [New  Developer] » Naijacrawl
Photo: Naijacrawl

JetBrains announced the release of PhpStorm 2019.1.This week with debugging support for Blade (and Twig) templates and a new predefined Laravel code style configuration.

 

Upgrade your Laravel applications to Laravel 5.8 and get XDebug ready to start debugging Laravel Blade templates in PhpStorm 2019.

 

Thanks to a Laravel 5.8 contribution for including the Laravel 5.8 Blade Template File Path in compiled templates, now you can set a breakpoint directly in a blade file instead of having to search for the compiled template and setting a breakpoint: Another Laravel-related feature in PhpStorm 2019.1 is a predefined Laravel code style setting.

 

You can configure it for your project from the preferences menu — Settings > Editor > Code Style > PHP and then select “set from > Predefined Style > Laravel”:

 

If you want to get a quick overview of what’s new, check out this video from JetBrains: The official PhpStorm blog has a PhpStorm 2019.1 release announcement post with all the details of the release.

site


kizinho

I am a software developer, like meeting people and love blogging, that's why I developed naijacrawl because that's what I love doing.

Continue Reading
Click To Comment

BE First To Comment


    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Laravel 7 comes with Easy Implicit Route Model Binding

    kizinho

    Published

    on

    NEWS: Laravel 7 comes with Easy Implicit Route Model Binding [New  Developer] » Naijacrawl
    Photo: Naijacrawl

    Laravel 7 will be out 2020 with new awesome features. You can clean the way routing is been done with one line of code.

    But you can try the dev version by running this code

    laravel new example --dev
    


    In laravel 7 you can bind routes like this:


    Route::get('/posts/{post:slug}', function (Post $post) {
        // ...
    });
    
    


    Currently, Laravel 6 and below requires you to define a getRouteKeyName() method on the model like so:

    <?php
    
    class Post extends Model
    {
        /**
         * Get the route key for the model.
         *
         * @return string
         */
        public function getRouteKeyName()
        {
            return 'slug';
        }
    }
    


    You can use the below route binding when you have multiple routes that you want to bind differently.

    For example, the frontend route uses slugs to display posts and backend admin uses ids to manage posts:


    Route::get('/posts/{post:slug}', function (Post $post) {
        // ...
    });
    
    // Or you could use the default `{post}` here...
    Route::get('/admin/posts/{post:id}/edit', function (Post $post) {
        // ...
    });
    


    Thanks for reading.



    Continue Reading

    Laravel 6.5.2 Released this week for bug fix

    kizinho

    Published

    on

    NEWS: Laravel 6.5.2 Released this week for bug fix [New  Developer] » Naijacrawl
    Photo: Naijacrawl

    The Laravel team released v6.5.2 this week—this version is a patch version release, containing mostly changes and fixes.

    Here’s a few things of note:

    • If you’re using PostGIS types in Postgres, Laravel now supports a separation between geometry and geography types.
    • The BelongsToMany::cursor() method, now hydrates pivot relations.
    • Model serialization on jobs allows typed properties.

    You can see the full list of new features and updates below and the whole diff between 6.5.1 and 6.5.2 on GitHub. The full release notes for Laravel 6.0 are available in the GitHub v6 changelog:

    v6.5.2

    Added

    • Allowed model serialization on jobs for typed properties (#30604, #30605, 920c364)
    • Allowed fallback when facade root accessor has previously been resolved (#30616)
    • Added support for separation between geometry and geography types for Postgres (#30545)
    • Added createWithContent() method to Illuminate\Http\Testing\File and Illuminate\Http\Testing\FileFactory (2cc6fa3, 181db51)

    Refactoring

    • Improved PostgresGrammar::formatPostGisType() method readability (#30593)

    Changed

    • Added symfony/debug dependency to illuminate/pipeline (#30611)
    • Override BelongsToMany::cursor() to hydrate pivot relations (#30580)
    • Ignore Redis prefix when verifying channel access in RedisBroadcaster (#30597, d77ce36)


    Continue Reading

    How to Automate App Setup with Laravel Initializer

    kizinho

    Published

    on

    NEWS: How to Automate App Setup with Laravel Initializer [New  Developer] » Naijacrawl
    Photo: Naijacrawl

    Have you ever found yourself writing multiple manual steps to set up a Laravel application in a new environment? Laravel Initializer is a convenient way to automate installing and updating a Laravel application:

    Laravel Initializer gives you the ability to declare multiple processes and run them with app:install and app:update artisan commands, which run predefined actions chain depending on the current environment.

    The app:install and app:update commands use two distinct classes that run commands based on a given environment. First, the install command uses the App\Install class:

    namespace App;
    
    use MadWeb\Initializer\Contracts\Runner;
    
    class Install
    {
        public function production(Runner $run)
        {
            return $run
                ->external('composer', 'install', '--no-dev', '--prefer-dist', '--optimize-autoloader')
                ->artisan('key:generate')
                ->artisan('migrate', ['--force' => true])
                ->artisan('storage:link')
                ->external('npm', 'install', '--production')
                ->external('npm', 'run', 'production')
                ->artisan('route:cache')
                ->artisan('config:cache')
                ->artisan('event:cache');
        }
    
        public function local(Runner $run)
        {
            return $run
                ->external('composer', 'install')
                ->artisan('key:generate')
                ->artisan('migrate')
                ->artisan('storage:link')
                ->external('npm', 'install')
                ->external('npm', 'run', 'development');
        }
    }
    
    

    The app:update command looks similar, using an App\Update class:

    namespace App;
    
    use MadWeb\Initializer\Contracts\Runner;
    
    class Update
    {
        public function production(Runner $run)
        {
            return $run
                ->external('composer', 'install', '--no-dev', '--prefer-dist', '--optimize-autoloader')
                ->external('npm', 'install', '--production')
                ->external('npm', 'run', 'production')
                ->artisan('route:cache')
                ->artisan('config:cache')
                ->artisan('event:cache')
                ->artisan('migrate', ['--force' => true])
                ->artisan('cache:clear')
                ->artisan('queue:restart'); ->artisan('horizon:terminate');
        }
    
        public function local(Runner $run)
        {
            return $run
                ->external('composer', 'install')
                ->external('npm', 'install')
                ->external('npm', 'run', 'development')
                ->artisan('migrate')
                ->artisan('cache:clear');
        }
    }
    
    

    You can also inject dependencies from the service container if you need to access services while running commands.

    This package contains a variety of runner actions you should check out in the readme. I found the MakeCronTask dispatch interesting:

    $run->dispatch(new \MadWeb\Initializer\Jobs\MakeCronTask)
    
    

    MakeCronTask adds the following to the server’s crontab list:

    * * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
    
    

    You can do other things like creating a supervisord config for a typical queue worker or horizon.

    You can learn more about this package, get full installation instructions, and view the source code on GitHub at mad-web/laravel-initializer.

    Continue Reading

    Latest



    Face of Naijacrawl


    ChukwubuikemSunday ChukwubuikemSunday

    Sunday Chukwubuikem


    Higher - 09061773292

    Trending