Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

Archive for Grudzień, 2015

Matt Stauffer: Middleware groups in Laravel 5.2

Matt Stauffer: Middleware groups in Laravel 5.2

In the next part of his series spotlighting features in the most recent release of the Laravel framework (5.2), Matt Stauffer continues with a look at middleware groups.

When you are creating a site of any significant size in Laravel, your routes file will often get pretty large. One of the first things I do in a new site is group my routes by logically distinct sections like “admin”, “auth”, “public”. Usually each of these groups get their own set of middleware—admin, for example, gets auth. Maybe the API group gets a different auth middleware, and it might get an API-specific rate limiter or something else.

Laravel 5.2 has introduced something called middleware groups, which are essentially a shortcut to applying a larger group of middleware, using a single key.

He takes his example above and makes an "admin" middleware group that lets you combine individual middlewares into a single callable set. He shows how to update your HttpKernel.php file with the new "auth" group and nest the "web" and "auth" middleware inside. He talks briefly about how this handling has changed from 5.1, pointing out that things without the "web" middleware will not have access to cookies/sessions/CSRF handling. He then includes an example showing how to use this "admin" grouping in your routes, either directly on a route or through a route grouping.

Source: http://www.phpdeveloper.org/news/23499

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Community News: Recent posts from PHP Quickfix (12.23.2015)

Community News: Recent posts from PHP Quickfix (12.23.2015)

Recent posts from the PHP Quickfix site:

Source: http://www.phpdeveloper.org/news/23498

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Ajax file upload PHP / jQuery Tutorial

Ajax file upload PHP / jQuery TutorialThe asynchronous file upload, using some XMLHttpRequest (Ajax), is technically not possible. Most JavaScript examples and tutorials call this method still Ajax upload and the image or file is uploaded by using a “virtual IFRAME”. Anyway it’s still user friendly way to provide an upload function for your visitors or users. In this quick tutorial […]


Source: http://feedproxy.google.com/~r/WebDevelopmentBlog/~3/qqdAW_7zpIA/

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Ajax file upload PHP / jQuery Tutorial

Ajax file upload PHP / jQuery TutorialThe asynchronous file upload, using some XMLHttpRequest (Ajax), is technically not possible. Most JavaScript examples and tutorials call this method still Ajax upload and the image or file is uploaded by using a “virtual IFRAME”. Anyway it’s still user friendly way to provide an upload function for your visitors or users. In this quick tutorial […]


Source: http://feedproxy.google.com/~r/WebDevelopmentBlog/~3/qqdAW_7zpIA/

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Laravel News: Laravel 5.2 is released!

Laravel News: Laravel 5.2 is released!

The Laravel News site has posted about the release of Laravel 5.2, the next minor release in the 5.x series of the framework. Along with this release comes several new features and additions to current ones:

Laravel 5.2 is now officially released and available to everyone. This release features multiple authentication driver support, implicit model binding, simplified Eloquent global scopes, opt-in authentication scaffolding, middleware groups, rate limiting middleware, array validation improvements, and more.

He then gets into a bit of detail about these new features added including:

  • Auth Scaffolding
  • Implicit model binding
  • Laravel 5.2 Form Array Validation
  • Database Session Driver
  • Middleware Groups
  • Rate Limiting

There’s brief code examples for each of the items (where needed) and links back to the documentation for more information on the feature’s use.

Source: http://www.phpdeveloper.org/news/23497

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Laravel News: Laravel 5.2 is released!

Laravel News: Laravel 5.2 is released!

The Laravel News site has posted about the release of Laravel 5.2, the next minor release in the 5.x series of the framework. Along with this release comes several new features and additions to current ones:

Laravel 5.2 is now officially released and available to everyone. This release features multiple authentication driver support, implicit model binding, simplified Eloquent global scopes, opt-in authentication scaffolding, middleware groups, rate limiting middleware, array validation improvements, and more.

He then gets into a bit of detail about these new features added including:

  • Auth Scaffolding
  • Implicit model binding
  • Laravel 5.2 Form Array Validation
  • Database Session Driver
  • Middleware Groups
  • Rate Limiting

There’s brief code examples for each of the items (where needed) and links back to the documentation for more information on the feature’s use.

Source: http://www.phpdeveloper.org/news/23497

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Voices of the ElePHPant: Interview with Marco Pivetta

Voices of the ElePHPant: Interview with Marco Pivetta

The Voices of the ElePHPant podcast has posted their latest interview in a series of talks host Cal Evans does with members of the PHP community. In this latest show Cal talks with Marco Pivetta of Roave.

Cal and Marco talk about how he (Marco) sees the PHP community currently and if there’s places where he sees it should grow and improve. They also talk more specifically about the community in Europe and the areas where things are growing at a rapid pace. They also talk about the work Marco does maintaining the Doctrine database abstraction layer package and how he got involved. The interview finishes with them talking about Roave, what kinds of things they work on and what it’s like working there.

You can listen to this latest episode either through the in-page audio player or by downloading the mp3 directly. If you enjoy the show be sure to subscribe to their feed or follow them on Twitter.

Source: http://www.phpdeveloper.org/news/23496

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Voices of the ElePHPant: Interview with Marco Pivetta

Voices of the ElePHPant: Interview with Marco Pivetta

The Voices of the ElePHPant podcast has posted their latest interview in a series of talks host Cal Evans does with members of the PHP community. In this latest show Cal talks with Marco Pivetta of Roave.

Cal and Marco talk about how he (Marco) sees the PHP community currently and if there’s places where he sees it should grow and improve. They also talk more specifically about the community in Europe and the areas where things are growing at a rapid pace. They also talk about the work Marco does maintaining the Doctrine database abstraction layer package and how he got involved. The interview finishes with them talking about Roave, what kinds of things they work on and what it’s like working there.

You can listen to this latest episode either through the in-page audio player or by downloading the mp3 directly. If you enjoy the show be sure to subscribe to their feed or follow them on Twitter.

Source: http://www.phpdeveloper.org/news/23496

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

SitePoint PHP Blog: Easier Authentication with Guard in Symfony 3

SitePoint PHP Blog: Easier Authentication with Guard in Symfony 3

The SitePoint PHP blog has posted a new tutorial from author Daniel Sipos showing the Symfony framework users out there how to do easier authentication with Guard, a newer component introduced to the framework to take some of the complexity out of the process.

The Symfony2 security system is a complex part of the framework, one that is difficult to understand and work with for many people. It is very powerful and flexible, however not the most straightforward.

[...] With the release of version 2.8 (and the much awaited version 3), a new component was accepted into the Symfony framework: Guard. The purpose of this component is to integrate with the security system and provide a very easy way for creating custom authentications. It exposes a single interface, whose methods take you from the beginning to the end of the authentication chain: logical and all grouped together.

He starts off with the configuration changes you’ll need to add/make to use the Guard component, defining an "in memory" admin user type. He shows how to define the firewall to use a Guard form authenticator and update the security configuration with the path matches and related roles. He then gets into the controller side of things, defining a loginAction and a simple username/password form in the matching view. Finally, he updates the services configuration for the authenticator and creates the full FormAuthenticator class to go along with it. He then explains each piece of this puzzle and how it all works together to make the authentication happen.

Source: http://www.phpdeveloper.org/news/23494

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

SitePoint PHP Blog: Easier Authentication with Guard in Symfony 3

SitePoint PHP Blog: Easier Authentication with Guard in Symfony 3

The SitePoint PHP blog has posted a new tutorial from author Daniel Sipos showing the Symfony framework users out there how to do easier authentication with Guard, a newer component introduced to the framework to take some of the complexity out of the process.

The Symfony2 security system is a complex part of the framework, one that is difficult to understand and work with for many people. It is very powerful and flexible, however not the most straightforward.

[...] With the release of version 2.8 (and the much awaited version 3), a new component was accepted into the Symfony framework: Guard. The purpose of this component is to integrate with the security system and provide a very easy way for creating custom authentications. It exposes a single interface, whose methods take you from the beginning to the end of the authentication chain: logical and all grouped together.

He starts off with the configuration changes you’ll need to add/make to use the Guard component, defining an "in memory" admin user type. He shows how to define the firewall to use a Guard form authenticator and update the security configuration with the path matches and related roles. He then gets into the controller side of things, defining a loginAction and a simple username/password form in the matching view. Finally, he updates the services configuration for the authenticator and creates the full FormAuthenticator class to go along with it. He then explains each piece of this puzzle and how it all works together to make the authentication happen.

Source: http://www.phpdeveloper.org/news/23494

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>