Quantcast
Channel: Laravel News
Viewing all 1837 articles
Browse latest View live

Git 2.10 is released

$
0
0

Git has released version 2.10 and the new version now includes progress reporting for pushes, better signature validation, and more.

For those that like to customize their terminal colors, Git now understands italic and strikethrough attributes, hello Operator Mono. In addition, the %C(auto) placeholder has been fixed, color support now works out of the box on FreeBSD, and the default colors for HEAD decorations have been tweaked to increase visibility.

You can check out the full release notes on Github, and you can upgrade through the official Git site or through your package manager.


Josh - Laravel Admin Template with CRUD Builder (Sponsor)

$
0
0

Josh Laravel admin template with GUI Builder is a bootstrap based admin panel and front-end built for Laravel developers.

Using the included CRUD builder you can quickly generate models, controllers, and views optimized for the Josh look and feel. This can save you at least 50% of developer time on the typical boring CRUD tasks.

josh2

It ships with Laravel based authentication, user management, groups management, a blog, and more.

It includes 100+ components like a form builder, charts, data tables, image upload/resizing, shopping cart UI, and advanced modals.

More features include:

  • Support for laravel 5.1 and 5.2 ( 5.3 support coming soon)
  • Many laravel examples added
  • Built with bootstrap 3.3.6
  • 80+ admin pages included
  • 10+ frontend pages included
  • 404, 500 pages included
  • Authentication and Authorization comes ready to use
  • Drag and drop form builder
  • 50+ chart examples
  • Calendar UI
  • Tables: search, copy, and export to PDF or CSV
  • Mailbox UI
  • Gallery, image upload, image cropping UI, sweet alert
  • Shopping cart UI

If you are starting a new Laravel project, JOSH will save tons of your time and gives excellent UI for your project.

It’s being updated continuously so you can get many more features and the best part is all updates are free for forever. Check it out today.

***

Many thanks to Josh for sponsoring Laravel News this week.

Building a Search Engine Friendly Sitemap XML with Laravel

$
0
0

A few years ago search engines recommended submitted sitemaps to help with indexing your website and now the importance of this is debatable.

I’m of the mindset creating and submitting can’t hurt, so I spent a little time putting one together and wanted to share how easy this is in Laravel.

What is a sitemap

If you are not familiar with a Sitemap, Google defines it as:

A sitemap is a file where you can list the web pages of your site to tell Google and other search engines about the organization of your site content. Search engine web crawlers like Googlebot read this file to more intelligently crawl your site.

They also outline the following reasons on why you need one:

  • Your site is really large. As a result, it’s more likely Google web crawlers might overlook crawling some of your new or recently updated pages.
  • Your site has a large archive of content pages that are isolated or well not linked to each other. If you site pages do not naturally reference each other, you can list them in a sitemap to ensure that Google does not overlook some of your pages.
  • Your site is new and has few external links to it. Googlebot and other web crawlers crawl the web by following links from one page to another. As a result, Google might not discover your pages if no other sites link to them.
  • Your site uses rich media content, is shown in Google News, or uses other sitemaps-compatible annotations. Google can take additional information from sitemaps into account for search, where appropriate.

Your site might not hit those criteria, but as I mentioned, I still believe it’s worth submitting one just to be safe.

The Sitemap Protocol

On the official Sitemaps website it outlines all the information you will need for building your own sitemap. Instead of reading through the whole spec here is a basic sample with a single url entered:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <url>
      <loc>http://www.example.com/</loc>
      <lastmod>2005-01-01</lastmod>
      <changefreq>monthly</changefreq>
      <priority>0.8</priority>
   </url>
</urlset> 

As you can see, it’s just an XML file with an individual <url> for each of your sites pages.

A single file can hold around 50,000 records, but you also have the ability to separate them out into multiple files and utilize an index file to point to the others.

The spec outlines this style like this:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <sitemap>
      <loc>http://www.example.com/sitemap1.xml.gz</loc>
      <lastmod>2004-10-01T18:23:17+00:00</lastmod>
   </sitemap>
   <sitemap>
      <loc>http://www.example.com/sitemap2.xml.gz</loc>
      <lastmod>2005-01-01</lastmod>
   </sitemap>
</sitemapindex>

Inside each <loc> it points to a file that it includes the <url> items like in the first example.

For this tutorial, I’m going to use the index style because I have records coming from different tables. This allows me the opportunity to customize each list of URL’s in the correct format without having to do extra processing.

Building a Sitemap Controller.

My sitemap will have two primary sections, and they are blog posts, blog categories, and podcast episodes. Each of these will be in their own file, and the index will point to them.

To get started let’s create a new sitemap controller:

php artisan make:controller SitemapController

Now open this file and let’s create a sitemap index.

Creating the Sitemap Index

Create a new index method that will generate the XML needed:

public function index()
{
  $post = Post::active()->orderBy('updated_at', 'desc')->first();
  $podcast = Podcast::active()->orderBy('updated_at', 'desc')->first();

  return response()->view('sitemap.index', [
      'post' => $post,
      'podcast' => $podcast,
  ])->header('Content-Type', 'text/xml');
}

The post and podcast queries are needed to generate the last modified timestamp in our index view as that informs the crawlers if new content has been added since they last looked.

Also, if you are not familiar with this return style what it is doing is returning a response object, with an assigned view, and setting the text/xml header. If you only return a view() then the header isn’t available so by including the response first this gives you access to include it.

Next our sitemap.index view file will look like this:

<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <sitemap>
        <loc>https://laravel-news.com/sitemap/posts</loc>
        <lastmod>{{ $post->publishes_at->tz('UTC')->toAtomString() }}</lastmod>
    </sitemap>
    <sitemap>
        <loc>https://laravel-news.com/sitemap/categories</loc>
        <lastmod>{{ $post->publishes_at->tz('UTC')->toAtomString() }}</lastmod>
    </sitemap>
    <sitemap>
        <loc>https://laravel-news.com/sitemap/podcasts</loc>
        <lastmod>{{ $podcast->publishes_at->tz('UTC')->toAtomString() }}</lastmod>
    </sitemap
</sitemapindex>

For this view, I’m just taking my custom publishes_at timestamp and using Carbon to set the timezone to UTC and finally using the Carbon Atom string helper to format it correctly.

Creating the Sitemap URL file

The next step is creating each URL file. The controller gets three new methods, and all are very similar. Here is an example:


public function posts() { $posts = Post::active()->where('category_id', '!=', 21)->get(); return response()->view('sitemap.posts', [ 'posts' => $posts, ])->header('Content-Type', 'text/xml'); } public function categories() { $categories = Category::all(); return response()->view('sitemap.categories', [ 'categories' => $categories, ])->header('Content-Type', 'text/xml'); } public function podcasts() { $podcast = Podcast::active()->orderBy('updated_at', 'desc')->get(); return response()->view('sitemap.podcasts', [ 'podcasts' => $podcast, ])->header('Content-Type', 'text/xml'); }

Once that is setup here is an example view file from sitemap.posts:

<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    @foreach ($posts as $post)
        <url>
            <loc>https://laravel-news.com/{{ $post->uri }}</loc>
            <lastmod>{{ $post->publishes_at->tz('UTC')->toAtomString() }}</lastmod>
            <changefreq>weekly</changefreq>
            <priority>0.6</priority>
        </url>
    @endforeach
</urlset>

With that in place and then duplicated for each of your sections it should be ready to go as soon as you add your routes. Here is how mine are setup:

Route::get('/sitemap', 'SitemapController@index');
Route::get('/sitemap/posts', 'SitemapController@posts');
Route::get('/sitemap/categories', 'SitemapController@categories');
Route::get('/sitemap/podcasts', 'SitemapController@podcasts');

You may notice I elected to not use the XML file extension and that is not a requirement. However, if you would like to use it then you can add the extension to the route:

Route::get('/sitemap.xml', 'SitemapController@index');

Then just adjust the views to point to the proper location.

Wrap up

As you hopefully see building your sitemap is not that difficult with Laravel, especially when your site structure is simple like mine. If you’d like to automate this whole process packages do exist and it might save you time using those.

If you’d like to go further, you can also build image and video sitemaps, as well as create your own XSL stylesheet.

Happy SEOing!

Podcast: Laravel 5.3 and Shift with Taylor Otwell and Jason McCreary

Laravel News T-Shirts - 2016 Edition

$
0
0

This years Laravel News t-shirt and hoodies are now available for purchase from Teespring.

For the 2016 edition I partnered with Zaengle, who handled the recent redesign of Laravel News, to create a unique design that combines the logo and the elephant used in the footer.

It comes in three styles: a unisex tee, womens, and a hoodie perfect for those late night coding sessions.

laravelnews-shirts

These will only be available for purchase for the next 20 days, so reserve yours before time runs out.

Lumen 5.3 is released

$
0
0

Lumen 5.3 is now released and available for all. This is considered a maintenance release that upgrades the underlying packages to the Laravel 5.3 series.

Before upgrading your application to Lumen 5.3, you should review the Laravel 5.3 upgrade guide and make any applicable changes to your application according to which Laravel components you are using.

Once you have made the necessary adjustments to your application, you may upgrade your Lumen framework dependency in your composer.json file and run the composer update command:

"laravel/lumen-framework": "5.3.*"

For more information checkout the official Lumen documentation.

Edit your environment files through the browser with Brotzka .env-Editor

$
0
0

When you’re working with Laravel, every installation includes a .env example file in your application’s root folder. This allows you to keep sensitive information out of version control and makes it easier to have different configurations based on the environment your application is running.

Brotzka .env-Editor is a third party package that aims to offer alternatives to the current manual way for editing Environment variables through .env file. It provides a graphical user interface to view, manage, backup and restore .env file. Plus it provides a lot of useful functions that can be used in your application to manage your .env file dynamically.

Let’s take a look at this package.

Installation

First, install Brotzka .env-Editor through Composer:

composer require brotzka/laravel-dotenv-editor

Then add its Service provider in config/app.php:

'providers' => [
    ...
    Brotzka\DotenvEditor\DotenvEditorServiceProvider::class,

Add the following line to your config/app.php aliases:

'DotenvEditor' => Brotzka\DotenvEditor\DotenvEditorFacade::class,

Finally, you have to publish the config file and view so you can edit it as you want, run the following command in your terminal:

php artisan vendor:publish --provider="Brotzka\DotenvEditor\DotenvEditorServiceProvider"

Now you have everything you need to start using the Brotzka .env-Editor.

Overview

If you opened .env-Editor configuration file config/dotenveditor.php, you will find two groups of settings, the first group is Path configuration which you can edit to specify the path for your project .env file and your .env files backup path:

'pathToEnv'         =>  base_path() . '/.env',
'backupPath'        =>  base_path() . '/resources/backups/dotenv-editor/',

The second setting group is GUI-Settings which you can choose to enable/disable editing .env via a graphical interface and the route that you can access this graphical user interface from:

// Activate or deactivate the graphical interface
    'activated' => true,

// Set the base-route. All requests start here
    'route' => '/enveditor',

Graphical User Interface

Now let’s access /enveditor via the browser to view Brotzka .env-Editor graphical user interface, you will see four different tabs:

1. Overview tab:

overview

After you click the Load button to import your .env file contents, you will see your current Environment variables as key/value pairs. On the right column, there are action buttons to edit or remove any variable from the list.

2. Add New tab:

add-new

In the Add New you can create a new variable in your .env file easily by filling the fields and clicking the Add button.

3. Backups tab:

backups

In the Backups tab, you can create a new backup of your .env file by clicking Create Backup button, bellow that there is a available backups list which have all your previous taken backups. And to the right of that list, you will find the action buttons which you can use to view, restore, download and delete a .env file backup.

4. Upload tab:

upload

And the last tab is Upload, which provide the ability to restore a previous .env file backup by uploading it from your storage, be aware that this will override your currently active .env file.

Managing .env files from your code

Brotzka .env-Editor provides a lot of useful functions that you can access through an instance of the DotenvEditor class. For example, there are functions for getting the value of a given key, checking if a key exists, adding the new key-value pair, changing a value of a variable, creating/restoring backups and more…
You can take a look at all available functions on .env-Editor docs.

Here is an example of utilizing .env-Editor functions to manipulate the .env file:

namespace App\Http\Controllers;

use Brotzka\DotenvEditor\DotenvEditor;

class EnvController extends Controller
{
    public function editDotEnv(){
        $env = new DotenvEditor();

        // Adds APP_ENV key if not existed
        if(!$env->keyExists("APP_ENV"){
            $env->addData([
                'APP_ENV' => 'production'
            ]);
        }

        // Changes the value of the Database name and username
        $env->changeEnv([
            'DB_DATABASE'   => 'laravel-news',
            'DB_USERNAME'   => 'diaafares',
        ]);
    }
}

That’s it, give Brotzka .env-Editor a try if you are looking for convenient ways to manage your .env file through your code or your browser. You can check out the source code of Brotzka .env-Editor at Github.

Laravel Spark v2 is now released

$
0
0

Laravel Spark, the commercial Laravel package that provides instant scaffolding for subscription billing, has just released v2.

The 2.0 release is a free upgrade for all license holders and it adds compatibility with Laravel 5.3 as well as deprecating the Spark installer in favor of using Composer directly.

This also adds dependency updates so it is compatible with both Echo and Passport that are new packages in Laravel 5.3.

The upgrade guide says you should review the entire Laravel 5.3 upgrade guide and make any changes to your application to reflect those changes. After that, there are no further code upgrades you need to make before using Spark 2.0.

Once you have completed applying the changes listed in the Laravel 5.3 upgrade guide, you are ready to upgrade your underlying Spark dependency.


Laravel 5.3.8 is released with new fakes for events, jobs, mail, and notifications

$
0
0

Laravel 5.3.8 is now released with new improvements for testing by included new fakes for events, jobs, mail, and notifications.

Here is a quick look at how these new testing featurs work:

Laravel Events

Laravel now provides three helpers for mocking events. The first is expectsEvents method which verifies the expected events are fired, but prevents any listeners for those events from executing. The second is the inverse doesntExpectEvents to verify that the given events are not fired:

public function testOrderShipping()
{
    $this->expectsEvents(OrderShipped::class);
    $this->doesntExpectEvents(OrderFailedToShip::class);

The next helper is withoutEvents which prevents all events from running:

public function testUserRegistration()
{
    $this->withoutEvents();

As an alternative to mocking, you may use the Event facade’s fake method to prevent all event listeners from executing.

use App\Events\OrderShipped;
use App\Events\OrderFailedToShip;
use Illuminate\Support\Facades\Event;

class ExampleTest extends TestCase
{
    /**
     * Test order shipping.
     */
    public function testOrderShipping()
    {
        Event::fake();

        // Perform order shipping...

        Event::assertFired(OrderShipped::class, function ($e) use ($order) {
            return $e->order->id === $order->id;
        });

        Event::assertNotFired(OrderFailedToShip::class);
    }
}

These same style helpers can also be used in jobs, mail, and notifications and the documentation is already updated with all the details.

Upgrading to 5.3.8 should just be a matter of running composer update and these new features will be available to be used.

Vim 8.0 is released

$
0
0

The Vim editor has released their first major release in ten years, Vim 8.0.

This version includes many small features, numerous bug fixes, and the following major highlights:

Asynchronous I/O support, channels

Vim can now exchange messages with other processes in the background. This makes it possible to have servers do work and send back the results to Vim.

Closely related to channels is JSON support. JSON is widely supported and can easily be used for inter-process communication, allowing for writing a server in any language. The functions to use are |json_encode()| and |json_decode()|.

This makes it possible to build very complex plugins, written in any language and running in a separate process.

Jobs

Vim can now start a job, communicate with it and stop it. This is very useful to run a process for completion, syntax checking, etc. Channels are used to communicate with the job. Jobs can also read from or write to a buffer or a file.

Timers

Also asynchronous are timers. They can fire once or repeatedly and invoke a function to do any work. For example:

let tempTimer = timer_start(4000, 'CheckTemp')

This will call the CheckTemp() function four seconds (4000 milli seconds) later.

Partials

Vim already had a Funcref, a reference to a function. A partial also refers to a function, and additionally binds arguments and/or a dictionary. This is especially useful for callbacks on channels and timers. E.g., for the timer example above, to pass an argument to the function:

let tempTimer = timer_start(4000, function('CheckTemp', ['out']))

This will call CheckTemp(‘out’) four seconds later.

Lambda and Closure

A short way to create a function has been added: {args -> expr}. This is useful for functions such as filter() and map(), which now also accept a function argument. Example:

:call filter(mylist, {idx, val -> val > 20})

A lambda can use variables defined in the scope where the lambda is defined. This is usually called a |closure|.

User-defined functions can also be a closure by adding the “closure” argument

:func-closure|

Packages

Plugins keep growing and more of them are available than ever before. To keep the collection of plugins manageable package support has been added. This is a convenient way to get one or more plugins, drop them in a directory and possibly keep them updated. Vim will load them automatically, or only when desired.

New style tests

This is for Vim developers. So far writing tests for Vim has not been easy. Vim 8 adds assert functions and a framework to run tests. This makes it a lot simpler to write tests and keep them updated. Also new are several functions that are added specifically for testing.

Window IDs

Previously windows could only be accessed by their number. And every time a window would open, close or move that number changes. Each window now has a unique ID, so that they are easy to find.

Viminfo uses timestamps

Previously the information stored in viminfo was whatever the last Vim wrote there. Now timestamps are used to always keep the most recent items.

Wrapping lines with indent

The ‘breakindent’ option has been added to be able to wrap lines without changing the amount of indent.

Windows: DirectX support

This adds the ‘renderoptions’ option to allow for switching on DirectX (DirectWrite) support on MS-Windows.

GTK+ 3 support

The GTK+ 3 GUI works just like GTK+ 2 except for hardly noticeable technical differences between them. Configure still chooses GTK+ 2 if both 2 and 3 are available.

For more information on this release and for upgrading visit the official Vim site.

GitLab raises an additional $20 million and announces their master plan

$
0
0

Just off of GitLab’s 8.11 release, today they announced a new $20 million Series B funding and have outlined their master plan on how they are going to attempt to revolutionize developers workflow.

To help you get faster from idea to production, we are focusing on more than just the best tools, we are working to create the most natural and cohesive process to closely mirror the way developers work without duplicating effort or distraction of switching to multiple platforms. This additional capital gives us an incredible opportunity to expand our product offerings, create more collaborative tools and support development teams of all sizes.

Their vision is to create an integrated set of tools for the software development lifecycle, all within a single user interface:

  1. Idea (Chat)
  2. Issue (Tracker)
  3. Plan (Board)
  4. Code (IDE)
  5. Commit (Repo)
  6. Test (CI)
  7. Review (MR)
  8. Staging (CD)
  9. Production (Chatops)
  10. Feedback Cycle Analytics)

You can read more about their future plans on their master plan and they are having a live YouTube event at 1pm ET to cover all the details.

Angular 2.0 final is now released

$
0
0

Today, at a special meetup at Google HQ, the Angular team has released version 2.0.

Angular 1 first solved the problem of how to develop for an emerging web. Six years later, the challenges faced by today’s application developers, and the sophistication of the devices that applications must support, have both changed immensely. With this release, and its more capable versions of the Router, Forms, and other core APIs, today you can build amazing apps for any platform. If you prefer your own approach, Angular is also modular and flexible, so you can use your favorite third-party library or write your own.

Now that version 2.0 is released the Angular team is not planning on slowing down. Their future plans includes more guides, live examples, Angular Material 2, moving WebWorkers out of experimental, and bug fixes and non-breaking features for APIs marked as stable.

Another big change is Angular is now moving to semantic versioning, MAJOR.MINOR.PATCH, as defined by semver.

The 2016 Laravel Survey

$
0
0

Hi there, Ian from LaraJobs here. Eric is letting me take over Laravel News here for a moment to let you know about the new 2016 Laravel survey we’re running.

The Laravel community is growing fast and we thought it’d be interesting to see what types of projects people are taking on with Laravel as well as get some feedback on what the Laravel community could be doing better.

If you’re a Laravel developer or in charge of a Laravel team and have a few minutes we’d love for you to take the survey.

In a few week’s we’ll be tallying up the results and publishing an extensive analysis here on Laravel News with all the details.

Thanks!
Ian

1,000 Laravel Applications have been upgraded with Shift

$
0
0

In less than a year Laravel Shift, the tool that automatically upgrades your Laravel app to the latest version, has upgraded over 1,000 applications.

In the announcement post, Jason shares some details on the history of the product and how he is developing this project through preset milestones.

Its features were deliberately limited until I proved the product. Proof came in preset milestones of 100, 250, 500, and 1,000 Shifts. Each time Shift reached a milestone, I would spend more time either fixing bugs, adding minor features, or releasing new Shifts.

By reaching the 1,000 milestone he is going to be adding support for upgrading Laravel Packages as well as a new “human services” feature for those that want a personal service. Also, coming soon is a new design for the Shift brand and a new dashboard to manage all the Shift’s you have purchased.

It is a great service and I recently used Laravel Shift to upgrade this site a few weeks ago, the process worked flawless for me and I was impressed how easy it was.

View your routes through the browser with the Pretty Routes package

$
0
0

One nice Laravel feature is its routing, by visiting your routing file, you can get an eagle eye view of your application and a map that shows which URL is corresponding to which file.

By default, Laravel provides a handy Artisan command php artisan route:list that can be used to list your routes in a table in your terminal, Pretty Routes is a third party package that aims to offer an alternative way to view the routes through the browser.

Pretty Routes Installation

First, install Pretty routes through Composer:

composer require garygreen/pretty-routes

Then add its Service provider in config/app.php:

'providers' => [
    ...
    PrettyRoutes\ServiceProvider::class,

Finally, you have to publish the config file so you can configure it to your needs, run the following command in your terminal:

php artisan vendor:publish --provider="PrettyRoutes\ServiceProvider"

Now you have everything you need to start using the Pretty routes.

Pretty Routes Overview

If you opened Pretty routes configuration file config/pretty-routes.php, you will see the following:

return [
    /**
     * The endpoint to access the routes.
     */
    'url' => 'routes',

    /**
     * The methods to hide.
     */
    'hide_methods' => [
        'HEAD',
    ],
];

First, you can specify the route ‘url’ that you will access Pretty routes GUI through. Second, you can add the HTTP methods that you want to hide by adding them to ‘hide_methods’ array.

Now let’s access Pretty routes URL to view our routes through the browser, you will see nice looking list that displays HTTP method, Path, Name, Action and applied Middlewares for each route:

routes-list

The package does take into account your app.debug setting and will only display routes if your application is in debug mode.

The core

If you want to know how Pretty routes works, take a look at the following code inside pretty-routes/src/MainMiddleware.php file:

the-core

At line 18, there is a condition to check if requested URL equals the URL that you specify for accessing Pretty routes, If so, it reads all your routes and fill routes variable using getRoutes method, Then it responses with the Pretty routes view file and passes the routes variable with it. After that, the returned routes go through a series of foreach statements and formatting operations to structure the nice looking list that you see in the browser.


That’s it, give Pretty Routes a try if you are looking for a beautiful way to view your routes through the browser.


Podcast: Laravel 5.3.8, Spark 2, Lumen 5.3 and more!

The error management app Honey Badger now supports PHP

$
0
0

Honey Badger, the error management and exception notifier app, has announced an official PHP library for integration with their service.

The official client is available on GitHub and it supports PHP > 5.5. The documentation includes instructions for hooking into Laravel, but it’s for version 4.2. For Laravel 5.3 you will need to modify the app/Exceptions/Handler.php file and call the notify method from the report method:

use Honeybadger\Honeybadger;

public function report(Exception $e)
{
    Honeybadger::notify($e);
}

Honey Badger is a commercial service and they offer a free plan for non-commercial open-source projects.

Troubleshooting Laravel Valet on macOS Sierra

$
0
0

macOS Sierra was released just a few days ago and everybody is starting to upgrade. Some users of Laravel Valet have reported some problems and Adam Wathan has put together a list of common problems and troubleshooting tips to help resolve issues he’s been seeing.

With his permission to post here is a list of things to look for:

All I see is “It works!”

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart

Valet randomly dies

You are probably still on Valet ^1.1.19, you need to switch to the sierra branch.

  1. Edit ~/.composer/composer.json to point to dev-sierra:
    - "laravel/valet": "^1.1.19",
    + "laravel/valet": "dev-sierra",
    
  2. Run composer global update
  3. Restart Valet: valet restart

Every time I refresh I see a totally random file!

You are running Caddy 0.9.2.

  1. Run composer global update
  2. Ensure you are now running Caddy 0.9.1: ~/.composer/vendor/laravel/valet/bin/caddy -version
  3. Restart Valet: valet restart

I’m getting a 502 Bad Gateway error.

Usually, this means something is messed up with PHP FPM.

  1. Check the PHP FPM error log: cat /usr/local/opt/php70/var/log/php-fpm.log
  2. Try to resolve any errors you see.
  3. Restart Valet: valet restart

Where to Look for Valet Errors?

If you are still running into problems, here’s a list of log files to check:

  • Caddy start log:

    /tmp/com.laravel.valetServer.err

  • PHP FPM error log:

    /usr/local/opt/php70/var/log/php-fpm.log

  • Caddy error log:

    ~/.valet/Log/error.log


Update: Tonight I installed this on a brand new macOS Sierra install and hit a few issues related to the way homebrew installed PHP. When I installed PHP 7.0 it would not create the folder /usr/local/etc/php/. After much trial and error and with the help of Adam we found this bug report. The fix outlined here of installing from source does work:

brew install php70 --build-from-source

After that, I had to restart Valet and then it all started working.

Spark v2.0.8 is now released

$
0
0

Laravel Spark v2.0.8 is now released and includes two new features to make managing teams even better.

The first feature is support for renaming “Teams”.

taylorotwell_2016-sep-22

The second new feature is you can now require the credit card up front on team plans.

To get the latest version visit the official Spark site or run composer update.

Computer Vision Syndrome

$
0
0

In no point in human history have people been staring at bright screens just a few feet from their face like they are today. Computer vision syndrome or CVS (not to be confused with Concurrent Versions System) is one side effect to this, and it’s affecting millions of people.

The National Institute of Occupational Safety and Health reports computer vision syndrome affects about 90% of the people who spend three hours or more a day at a computer, which means almost everyone in our industry is susceptible.

In another study published by Medical Practice and Reviews reports that CVS is a vision disorder that has been described as the number one occupational hazard of the 21st century as the human eye finds today’s computerised gadgets difficult to cope with.

Here is how Wikipedia defines the syndrome:

Computer vision syndrome (CVS) is a condition resulting from focusing the eyes on a computer or other display device for protracted, uninterrupted periods of time. Some symptoms of CVS include headaches, blurred vision, neck pain, redness in the eyes, fatigue, eye strain, dry eyes, irritated eyes, double vision, vertigo/dizziness, polyopia, and difficulty refocusing the eyes. These symptoms can be further aggravated by improper lighting conditions (i.e. glare or bright overhead lighting) or air moving past the eyes (e.g. overhead vents, direct air from a fan).

A few weeks ago I had my annual eye doctor visit, and I was diagnosed. The doctor said my case was not severe; however, I still needed to take precautions and to start retraining my eyes.

As you sit in front of the screen, your eyes dry out, and you stop blinking. Over time this leads to damage of the eye muscle that is used to focus on far away objects and damage to the tear ducts.

He recommended I use a hot compress at least once a week for 10 minutes and to look away from the screen in a method called the 20-20-20-20 rule. Every 20 minutes take 20 seconds to look at an object at least 20 feet away and blink 20 times.

It sounds easy, and it is, but 20 minutes go by in a flash when you are deep in thought or trying to fix that pesky bug. After the first day I realized I couldn’t do this on my own and here is a list of apps that will help you take breaks.

Apps for Computer Vision Syndrome

Breaktime (Mac and iOS)
BreakTime is a simple utility that’s designed to help you remember to take breaks away from your computer. It never forgets a break, running in your dock or menu bar (or even in the background).

Eye Care (Mac)
Eye Care regularly reminds you to take breaks, shows you simple eye exercises and prevents you from using the computer at break times.

Pomodoro Time (Mac)
Pomodoro Time is a powerful personal productivity tool incorporating the principles of the Pomodoro Technique. Create tasks, configure breaks and track your progress throughout the day, week or custom period.

EyeLeo (Windows)
EyeLeo is a handy PC application that regularly reminds you to take short breaks for your eyes.

Eye Pro (Windows)
EyePro is a handy PC application that regularly reminds you to take “Short Breaks for your Eyes” with many exciting, customizable and Innovative features. It is an innovative tool done under the guidance of eminent Eye Doctors

These apps will help you take breaks because most completely take over the screen by overlaying with a dark overlay and prevent you from cancelling out.

Of course, these are not the only ways to deal with CVS, and if you have the will power, you can do it yourself or find other ways to distract yourself. For example here are some tips from others.

“My number one advice is to leave your television on. Crazy right? Eating, taking a break, and looking away from your monitor all take a backseat to the workflow you’re engrossed in. So what I’m about to say seems very counterproductive. Except it’s not. If you are sitting in front of your computer developing away and you have a television in your office, turn it on! The reason why I say this is because it’s obviously a distraction. A very good distraction. It actually forces you to look away from your computer monitor far more often than every 20 minutes. ” – Mike Garrett from TechU4ria

“I use the Windows app Eye Pro to encourage me to blink more. Because I commute to work every day and spend over 2 hours on public transport, I also tend to watch a lot of videos and read a lot of articles on my tablet, I also use Twilight which helps to reduce the blue light emission of my device so I can read more comfortably.” – Max Robinson, at AIMS Web Media

CVS can affect anyone at any age, even kids that are getting to much screen time, and I know everyone reading this spends way too much time on the screen, so it’s imperative that we take care of our eyes and consider the consequences of not taking enough breaks.

Viewing all 1837 articles
Browse latest View live