This document discusses using Form Requests in Laravel API implementations. Form Requests allow handling requests in a centralized way by validating data, authorizing access, and cleaning input. Key points covered include constructing an API with Laravel, classic request handling via controllers, and how Form Requests improve this by centralizing validation, authorization, and sanitization logic. Form Requests can also be customized to manipulate request data and log events. The document concludes that Form Requests promote clean code, security and reusability, though they can break the single responsibility principle if overused.
Datagrids with Symfony 2, Backbone and Backgrideugenio pombi
This document discusses using Backbone, Backgrid, and Symfony to build a datagrid application. It covers:
1) Setting up requirements including Symfony, Backbone dependencies, and FOSRestBundle.
2) Building Backbone models, collections, and associations to retrieve and represent ticket data.
3) Implementing a Backgrid grid with columns to display the ticket data.
4) Examples of extending Backgrid with features like select editors, toggle cells, and computed fields.
5) Testing the Backbone collections and API endpoints with sample test code.
As a PHP developer building web applications is besides making a living a lot of fun too, especially when you can deploy your apps to any kind of environment and on any platform. In this session I take a non-standard PHP application (based on Zend Framework) and deploy it to a bare metal environment running LAMP, Windows 2008 Server with IIS7 and to cloud instances like Azure and Amazon.
The goal is to provide information on how to deploy to these various environments manual and automatic, but also to show it doesn't really matter anymore what the targeted platform is, as long the apps are written in PHP.
The document discusses Perl web frameworks Catalyst and Mojolicious. It provides an overview of key MVC concepts like routers, controllers, models and views. It then demonstrates how to install and create a basic Catalyst application with a root controller and default action. It also covers additional Catalyst controller features like actions, routes, context object and chained actions.
This document summarizes a presentation about integrating JavaScript with Laravel. The speaker will explore building a game using Laravel and demonstrate how to:
1) Prepare Laravel by installing packages, generating database migrations and models, and setting up routes and controllers.
2) Add jQuery and custom scripts to views using Blade templating.
3) Pass PHP data to JavaScript in templates, either directly or using the laracasts/utilities package.
4) Make AJAX calls from JavaScript to Laravel controllers to retrieve and update data, including using named routes from the laravel-js-routes package.
This document discusses building REST APIs with Laravel 5. It covers topics like using REST instead of SOAP, authentication with basic authentication and middleware, response formats, controller hierarchy, repositories, data transformers, error handling, and an internal dispatcher for making internal API requests. The goal is to provide best practices and patterns for building robust and well-structured REST APIs with Laravel.
Mojo started as an alternative to the aging LWP library for HTTP requests in Perl. It was created by Sebastian Riedel to have a more modern, asynchronous API. Mojo provides an easy to use and full-featured HTTP client and server with support for features like websockets, parallel requests, and more. The library uses a test-driven development approach and strives to have a pragmatic design with reusable components.
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
Building a desktop app using HTTP::Engine as a micro web server, SQLite for data storage, and jQuery for the user interface. Comet and asynchronous workers are used to enable real-time features. JSON-RPC and routing are implemented to support AJAX actions. The combination provides a lightweight "desktop app" architecture that is cross-platform.
These are my slide from talk at PHPDay in Verona 20014.
Forget about classic website where UX is not so important. We are living in time where usability is one of the important thing if you are building some business client oriented web service. In locastic we are working on CRM that is based on Symfony2 as backend and AngularJS as frontend solution.
How to connect this two frameworks? What are best practices? What are disadvantageous? How to take best from both worlds? These are topics I will cover in my talk with real examples.
Datagrids with Symfony 2, Backbone and Backgrideugenio pombi
This document discusses using Backbone, Backgrid, and Symfony to build a datagrid application. It covers:
1) Setting up requirements including Symfony, Backbone dependencies, and FOSRestBundle.
2) Building Backbone models, collections, and associations to retrieve and represent ticket data.
3) Implementing a Backgrid grid with columns to display the ticket data.
4) Examples of extending Backgrid with features like select editors, toggle cells, and computed fields.
5) Testing the Backbone collections and API endpoints with sample test code.
As a PHP developer building web applications is besides making a living a lot of fun too, especially when you can deploy your apps to any kind of environment and on any platform. In this session I take a non-standard PHP application (based on Zend Framework) and deploy it to a bare metal environment running LAMP, Windows 2008 Server with IIS7 and to cloud instances like Azure and Amazon.
The goal is to provide information on how to deploy to these various environments manual and automatic, but also to show it doesn't really matter anymore what the targeted platform is, as long the apps are written in PHP.
The document discusses Perl web frameworks Catalyst and Mojolicious. It provides an overview of key MVC concepts like routers, controllers, models and views. It then demonstrates how to install and create a basic Catalyst application with a root controller and default action. It also covers additional Catalyst controller features like actions, routes, context object and chained actions.
This document summarizes a presentation about integrating JavaScript with Laravel. The speaker will explore building a game using Laravel and demonstrate how to:
1) Prepare Laravel by installing packages, generating database migrations and models, and setting up routes and controllers.
2) Add jQuery and custom scripts to views using Blade templating.
3) Pass PHP data to JavaScript in templates, either directly or using the laracasts/utilities package.
4) Make AJAX calls from JavaScript to Laravel controllers to retrieve and update data, including using named routes from the laravel-js-routes package.
This document discusses building REST APIs with Laravel 5. It covers topics like using REST instead of SOAP, authentication with basic authentication and middleware, response formats, controller hierarchy, repositories, data transformers, error handling, and an internal dispatcher for making internal API requests. The goal is to provide best practices and patterns for building robust and well-structured REST APIs with Laravel.
Mojo started as an alternative to the aging LWP library for HTTP requests in Perl. It was created by Sebastian Riedel to have a more modern, asynchronous API. Mojo provides an easy to use and full-featured HTTP client and server with support for features like websockets, parallel requests, and more. The library uses a test-driven development approach and strives to have a pragmatic design with reusable components.
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
Building a desktop app using HTTP::Engine as a micro web server, SQLite for data storage, and jQuery for the user interface. Comet and asynchronous workers are used to enable real-time features. JSON-RPC and routing are implemented to support AJAX actions. The combination provides a lightweight "desktop app" architecture that is cross-platform.
These are my slide from talk at PHPDay in Verona 20014.
Forget about classic website where UX is not so important. We are living in time where usability is one of the important thing if you are building some business client oriented web service. In locastic we are working on CRM that is based on Symfony2 as backend and AngularJS as frontend solution.
How to connect this two frameworks? What are best practices? What are disadvantageous? How to take best from both worlds? These are topics I will cover in my talk with real examples.
PSGI and Plack provide a common interface (PSGI) and shared infrastructure (Plack) for building web applications and frameworks in Perl. PSGI defines a standard way for applications to communicate with web servers through a request/response interface. Plack provides many server implementations like FastCGI and standalone that can run PSGI applications. It also includes middleware, testing tools, and utilities to help developers. This new approach allows frameworks and applications to focus on their logic while reusing common plumbing through PSGI and Plack.
This document discusses using Zend Framework for building web applications. It describes how Zend_Application provides dependency injection and configuration without requiring objects. It also covers using Zend_Db for database access, Zend_Controller for routing, and Zend_Translate for internationalization. Validation is discussed, including using Zend_Validate with Zend_Translate to internationalize error messages.
This document discusses using WebRTC in Perl to enable real-time communication between browsers. It explains that WebRTC allows peer-to-peer connections without plugins by using signaling to exchange endpoint details and ICE servers. It then provides over 350 lines of Perl code to demonstrate setting up a WebRTC connection between an "offerer" and "answerer" browser to allow sending messages over a data channel. The code connects the browsers as peers, exchanges session descriptions and ICE candidates, creates audio/video constraints, and includes a chat interface to test the connection.
Laravel uses a bootstrapping process when an HTTP request is received:
1. Providers are registered with the application service container to make services available.
2. Filters and routes are registered to handle requests.
3. The request is handled by the router and processed by the matched route, with filters applied. The route then dispatches the request to the appropriate controller.
Express is a web framework for Node.js that allows routing, middleware, templating and more. It is inspired by Sinatra and uses Connect as its middleware framework. Key features include routing, middleware support, template rendering with engines like Jade, and session handling with storage options. Errors can be handled via the app.error() method. Express provides a full-featured and easy to use web development framework for Node.js.
This document provides an overview of RESTful web services using Mojolicious and DBIx::Class. It describes a sample expense tracker application with five database tables in a many-to-many relationship. It then introduces REST concepts and describes how Mojolicious routes requests, DBIx::Class models the database, and generic controllers can provide CRUD operations. Finally, it outlines the steps to generate RESTful routes for a database table, including creating a model and controller that inherits standard CRUD methods.
Web service with Laravel:
Laravel Philosophy
Requirement
Installation
Basic Routing
Requests & Input
Request Lifecycle
Controller
Controller Filters
RESTful Controllers
Database Model using Eloquent ORM
Creating A Migration
Code Example
- PSGI (Perl Web Server Gateway Interface) and Plack provide a common interface and utilities for building web applications and servers in Perl.
- PSGI defines a standard interface that web frameworks can implement to work with different server implementations. Plack provides server implementations like standalone, FastCGI and Apache modules.
- This allows frameworks to focus on the application code instead of server specifics, and servers to handle multiple frameworks. Common middleware and testing utilities are also included.
- Examples of frameworks that have adopted PSGI include Catalyst, Maypole and Mojolicious. Popular servers built on Plack include Starman and Dancer.
Zend Framework is a PHP web application framework that uses a model-view-controller (MVC) architecture. It provides modules for common tasks like database access and Google APIs. The framework encourages separating code into models, views, and controllers. It also includes tools for creating projects, actions, forms and connecting to databases to build full-featured web applications.
This document summarizes Phinx, a PHP library for managing database migrations. It allows creating migrations to modify the database schema, rolling back changes if needed. Migrations are stored in version control and can be shared. Phinx provides a table API to create migrations in a database-agnostic way and supports rolling back changes. It works with MySQL, PostgreSQL, SQLite and more.
Slides from a presentation given at Laravel Chicago on November 18, 2014. Goes over the basics of building a REST API using the Laravel framework as well as some handy tips and tools.
Head First Zend Framework - Part 1 Project & ApplicationJace Ju
Zend Framework provides tools for creating PHP web applications. The zf script is used to generate a project skeleton and configure resources. The Zend_Application loads configuration from application.ini, initializes the bootstrap class, and runs the application. The bootstrap class initializes custom resources. Common resources like the front controller, database, and view are initialized through Zend_Application_Resource classes, which get configuration options from application.ini. This allows flexible configuration and initialization of an MVC application in Zend Framework.
The document summarizes the new features and improvements in CodeIgniter 3.0. Key highlights include increased number of commits compared to previous versions, improved database features like query builder and failover connections, new features like output minification and pagination improvements, and a focus on unit testing.
This document provides instructions for building a Rails API and discusses related topics. It recommends using Rails 3.1 and Ruby 1.9.2 to build the API. It provides steps to generate a MessagesController to handle API requests for messages. It discusses testing the API with curl and rspec tests. It also covers building a namespaced and versioned API, authentication, caching responses, hosting on DotCloud, and running background jobs with Delayed Job.
Tatsumaki is a non-blocking web framework for Perl built on Plack and AnyEvent. It allows building asynchronous applications that can handle thousands of concurrent connections. Tatsumaki uses psgi.streaming to enable asynchronous responses. It includes a non-blocking HTTP client and pure Perl message queue for building real-time applications like chat and comet. The framework is in a beta stage but plans include services for XMPP/IRC bots and a standard comet interface.
Alfresco study presentation 38th customize How-To WebDAVTakeshi Totani
This document discusses the configuration and implementation of WebDAV in Alfresco. It describes how WebDAV is configured as a servlet in Alfresco and defines methods for HTTP requests. It also explains how the WebDAVHelper class is used to retrieve node information and resolve paths, including adding support to locate a user's home folder in the repository.
This document summarizes some new features in PHP 5.4:
- Array syntax can now be written more concisely using square brackets instead of array functions.
- PHP 5.4 includes a built-in web server for development purposes, allowing PHP scripts to be run without Apache.
- Traits allow sharing of methods across classes to reduce code duplication, similar to mixins in Ruby.
- Closures now support accessing properties of the enclosing class scope via $this.
This document provides an overview of how checkout works in Spryker through the use of a step engine. It discusses key concepts like steps, step interfaces, preconditions, requirements, execution, conditions. It also covers related components like step collections, forms, data providers and containers. The step engine handles progressing through the checkout steps by ensuring preconditions are met before executing each step and persisting data in a transfer object.
PSGI and Plack provide a common interface (PSGI) and shared infrastructure (Plack) for building web applications and frameworks in Perl. PSGI defines a standard way for applications to communicate with web servers through a request/response interface. Plack provides many server implementations like FastCGI and standalone that can run PSGI applications. It also includes middleware, testing tools, and utilities to help developers. This new approach allows frameworks and applications to focus on their logic while reusing common plumbing through PSGI and Plack.
This document discusses using Zend Framework for building web applications. It describes how Zend_Application provides dependency injection and configuration without requiring objects. It also covers using Zend_Db for database access, Zend_Controller for routing, and Zend_Translate for internationalization. Validation is discussed, including using Zend_Validate with Zend_Translate to internationalize error messages.
This document discusses using WebRTC in Perl to enable real-time communication between browsers. It explains that WebRTC allows peer-to-peer connections without plugins by using signaling to exchange endpoint details and ICE servers. It then provides over 350 lines of Perl code to demonstrate setting up a WebRTC connection between an "offerer" and "answerer" browser to allow sending messages over a data channel. The code connects the browsers as peers, exchanges session descriptions and ICE candidates, creates audio/video constraints, and includes a chat interface to test the connection.
Laravel uses a bootstrapping process when an HTTP request is received:
1. Providers are registered with the application service container to make services available.
2. Filters and routes are registered to handle requests.
3. The request is handled by the router and processed by the matched route, with filters applied. The route then dispatches the request to the appropriate controller.
Express is a web framework for Node.js that allows routing, middleware, templating and more. It is inspired by Sinatra and uses Connect as its middleware framework. Key features include routing, middleware support, template rendering with engines like Jade, and session handling with storage options. Errors can be handled via the app.error() method. Express provides a full-featured and easy to use web development framework for Node.js.
This document provides an overview of RESTful web services using Mojolicious and DBIx::Class. It describes a sample expense tracker application with five database tables in a many-to-many relationship. It then introduces REST concepts and describes how Mojolicious routes requests, DBIx::Class models the database, and generic controllers can provide CRUD operations. Finally, it outlines the steps to generate RESTful routes for a database table, including creating a model and controller that inherits standard CRUD methods.
Web service with Laravel:
Laravel Philosophy
Requirement
Installation
Basic Routing
Requests & Input
Request Lifecycle
Controller
Controller Filters
RESTful Controllers
Database Model using Eloquent ORM
Creating A Migration
Code Example
- PSGI (Perl Web Server Gateway Interface) and Plack provide a common interface and utilities for building web applications and servers in Perl.
- PSGI defines a standard interface that web frameworks can implement to work with different server implementations. Plack provides server implementations like standalone, FastCGI and Apache modules.
- This allows frameworks to focus on the application code instead of server specifics, and servers to handle multiple frameworks. Common middleware and testing utilities are also included.
- Examples of frameworks that have adopted PSGI include Catalyst, Maypole and Mojolicious. Popular servers built on Plack include Starman and Dancer.
Zend Framework is a PHP web application framework that uses a model-view-controller (MVC) architecture. It provides modules for common tasks like database access and Google APIs. The framework encourages separating code into models, views, and controllers. It also includes tools for creating projects, actions, forms and connecting to databases to build full-featured web applications.
This document summarizes Phinx, a PHP library for managing database migrations. It allows creating migrations to modify the database schema, rolling back changes if needed. Migrations are stored in version control and can be shared. Phinx provides a table API to create migrations in a database-agnostic way and supports rolling back changes. It works with MySQL, PostgreSQL, SQLite and more.
Slides from a presentation given at Laravel Chicago on November 18, 2014. Goes over the basics of building a REST API using the Laravel framework as well as some handy tips and tools.
Head First Zend Framework - Part 1 Project & ApplicationJace Ju
Zend Framework provides tools for creating PHP web applications. The zf script is used to generate a project skeleton and configure resources. The Zend_Application loads configuration from application.ini, initializes the bootstrap class, and runs the application. The bootstrap class initializes custom resources. Common resources like the front controller, database, and view are initialized through Zend_Application_Resource classes, which get configuration options from application.ini. This allows flexible configuration and initialization of an MVC application in Zend Framework.
The document summarizes the new features and improvements in CodeIgniter 3.0. Key highlights include increased number of commits compared to previous versions, improved database features like query builder and failover connections, new features like output minification and pagination improvements, and a focus on unit testing.
This document provides instructions for building a Rails API and discusses related topics. It recommends using Rails 3.1 and Ruby 1.9.2 to build the API. It provides steps to generate a MessagesController to handle API requests for messages. It discusses testing the API with curl and rspec tests. It also covers building a namespaced and versioned API, authentication, caching responses, hosting on DotCloud, and running background jobs with Delayed Job.
Tatsumaki is a non-blocking web framework for Perl built on Plack and AnyEvent. It allows building asynchronous applications that can handle thousands of concurrent connections. Tatsumaki uses psgi.streaming to enable asynchronous responses. It includes a non-blocking HTTP client and pure Perl message queue for building real-time applications like chat and comet. The framework is in a beta stage but plans include services for XMPP/IRC bots and a standard comet interface.
Alfresco study presentation 38th customize How-To WebDAVTakeshi Totani
This document discusses the configuration and implementation of WebDAV in Alfresco. It describes how WebDAV is configured as a servlet in Alfresco and defines methods for HTTP requests. It also explains how the WebDAVHelper class is used to retrieve node information and resolve paths, including adding support to locate a user's home folder in the repository.
This document summarizes some new features in PHP 5.4:
- Array syntax can now be written more concisely using square brackets instead of array functions.
- PHP 5.4 includes a built-in web server for development purposes, allowing PHP scripts to be run without Apache.
- Traits allow sharing of methods across classes to reduce code duplication, similar to mixins in Ruby.
- Closures now support accessing properties of the enclosing class scope via $this.
This document provides an overview of how checkout works in Spryker through the use of a step engine. It discusses key concepts like steps, step interfaces, preconditions, requirements, execution, conditions. It also covers related components like step collections, forms, data providers and containers. The step engine handles progressing through the checkout steps by ensuring preconditions are met before executing each step and persisting data in a transfer object.
Symfony is a PHP web framework that provides features like templating, caching, internationalization and MVC architecture out of the box. It uses the Model-View-Controller pattern and includes tools for scaffolding, routing, form generation and more. Symfony projects can be created via the command line and include an auto-generated directory structure for applications, modules and actions.
The document describes the architecture of a web application that provides an API for a recipe application. It includes descriptions of the application layer, presentation layer, infrastructure layer, and domain layer. It then provides a detailed example of how the Chefkoch API implements these layers for an endpoint that saves a recipe category. Key aspects include using Symfony components, separating concerns into services, using commands and events, and enforcing security and data access policies.
This document discusses mashing up JavaScript applications. It covers topics like CORS and OAuth2 for API access, using local storage to store access tokens, templates with Mustache.js, and implementing real-time updates using WebSockets, ActivityStreams, and PubSubHubbub. Code examples are provided for building a JavaScript client that retrieves data from an API using OAuth2 authorization, renders content with templates, and allows posting new entries.
Mashing up JavaScript – Advanced Techniques for modern Web AppsBastian Hofmann
This document discusses advanced JavaScript techniques for building modern web applications. It covers topics like JavaScript apps, CORS and OAuth2 for API access, local storage, templates with Mustache.js, and real-time updates using WebSockets, PubSubHubbub and ActivityStreams. The document provides code examples for implementing OAuth2 login flows, making API requests, storing access tokens, and rendering data with templates. It also demonstrates a sample app that retrieves a feed and allows posting new entries.
The REST API is an awesome plugin to expose your data from the WordPress core. But … the standard implementation might not fit your specific case.
Just like the WordPress core, you'll be able to extend it to your specific needs. I'll show you how to handle authentication, introduce caching strategies, alter custom post types, or even change the default way of communication altogether.
This document defines routes and controllers for managing sessions in a Laravel application. The SessionController handles requests to view, set, and delete session data. It provides methods to store values in the session using put(), push() to add to arrays, and forget() to remove values. The main_view blade template contains links to trigger these session actions.
The REST API is an awesome plugin to expose your data from the WordPress core. But … the standard implementation might not fit your specific case.
Just like the WordPress core, you'll be able to extend it to your specific needs. I'll show you how to handle authentication, introduce caching strategies, alter custom post types, or even change the default way of communication altogether.
This document provides an overview and introduction to Laravel 5, a PHP web application framework. It discusses key Laravel 5 concepts and features such as Eloquent ORM, routing, middleware, contracts, form requests, the IoC container, file drivers, scheduling commands, and the command bus pattern. The document is intended to explain Laravel 5 concepts through code examples and brief explanations.
This document discusses using Zend Framework components to create web services. It describes creating an API class to move logic out of controllers and structure the application. The API class is used to build XML-RPC, SOAP, and REST servers and clients to access a timesheet application. DocBlocks are recommended to document the API. Moving functionality to a reusable API library saves development time and makes the application more maintainable and testable.
The document discusses techniques for using SQLite databases in iOS applications. Some key points covered include:
SQLite is a file-based, lightweight database that is well suited for mobile applications. The pure C API can be difficult to use directly, so it's best to abstract it away. The document reviews methods for opening and copying databases, executing queries using the SQLite API, and using prepared statements.
The document discusses SQLite, including that it is a file-based, single-user, cross-platform SQL database engine. It provides information on SQLite tools like SQLite Manager and the sqlite3 command line utility. It also covers how to use the SQLite API in iOS/macOS applications, including opening a database connection, executing queries, and using prepared statements. Key aspects covered are getting the documents directory path, copying a default database on app startup, and the callback signature for query results.
Come to this talk prepared to learn about the Doctrine PHP open source project. The Doctrine project has been around for over a decade and has evolved from database abstraction software that dates back to the PEAR days. The packages provided by the Doctrine project have been downloaded almost 500 million times from packagist. In this talk we will take you through how to get started with Doctrine and how to take advantage of some of the more advanced features.
This document discusses building web services using the Zend Framework. It introduces key components for building SOAP, XML-RPC, and RESTful services, including the Zend_Soap, Zend_XmlRpc, and Zend_Rest libraries. It provides an example of building a timesheet API and exposing it through different protocols, demonstrating how to define methods, handle requests and responses, and implement clients. Documentation of the API using docblocks is also covered.
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswanivvaswani
Explains how to use the Slim PHP micro-framework to quickly deploy a REST API. Includes sample code to implement common API requirements, such as authentication, request logging and multi-format support.
Learn about some of the new features in Laravel 5, with a focus on the command pipeline, including a few opinions about how to use the pipeline in the best possible way to enforce a solid separation of concerns.
PSR-7, middlewares e o futuro dos frameworksElton Minetto
PSR-7 defines standards for HTTP message interfaces in PHP. Middlewares operate between requests and responses, allowing discrete problem solving without being tied to a specific framework. Expressive is a micro-framework built on PSR-7 that allows writing middleware applications through routing, dependency injection, and error handling. The future involves fewer framework-specific applications and more middleware that can be composed together and used across frameworks.
Similar to Wykorzystanie form request przy implementacji API w Laravelu (20)
WebRTC+Websockety - Jak stworzyłem aplikację do kamerek internetowych w Larav...Laravel Poland MeetUp
#LaravelPolandMeetup #23
Laravel Poland MeetUp #23 online
Temat: WebRTC+Websockety - Jak stworzyłem aplikację do kamerek internetowych w Laravelu
W jaki sposób można zrealizować połączenie WebRTC w aplikacji opartej o Laravel+Vue
Autor: Mateusz Garbarczyk, MirIT
#LaravelPolandMeetup #22
Laravel Poland MeetUp #22 online
Temat: Kilka slajdów o castowaniu atrybutów w Eloquent
Autor: Miłosz Dziurzyński, HighSolutions
Kiedy warto skorzystać z Custom Casts? Jaka jest przewaga interfejsu #Castable? Jak napisać uniwersalną klasę castującą do Value Object?
#LaravelPolandMeetup #22
Laravel Poland MeetUp #22 online
Temat: Licencje otwartego oprogramowania
Autor: Joanna Rewak
Jakie są zasady działania licencji otwartego oprogramowania?
Jak należy rozumieć #licencje otwartego oprogramowania na przykładzie #Laravel i jego zależności? Czy możemy zarabiać na programach, które wykorzystują różne biblioteki? Czy musimy dodawać nazwiska twórców wykorzystywanych zależności?
#LaravelPolandMeetup #22
Laravel Poland MeetUp #22 online
Temat: Jak przyspieszyłem aplikację produkcyjną o ponad 40%
Autor: Patryk Filipiak
Czy #PHP może być szybki? Jak stworzyć kod, który sprawi, że #aplikacja będzie szybka? Jak mierzyć wydajność tworzonej aplikacji?
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Mobile app Development Services | Drona InfotechDrona Infotech
Drona Infotech is one of the Best Mobile App Development Company In Noida Maintenance and ongoing support. mobile app development Services can help you maintain and support your app after it has been launched. This includes fixing bugs, adding new features, and keeping your app up-to-date with the latest
Visit Us For :
Measures in SQL (SIGMOD 2024, Santiago, Chile)Julian Hyde
SQL has attained widespread adoption, but Business Intelligence tools still use their own higher level languages based upon a multidimensional paradigm. Composable calculations are what is missing from SQL, and we propose a new kind of column, called a measure, that attaches a calculation to a table. Like regular tables, tables with measures are composable and closed when used in queries.
SQL-with-measures has the power, conciseness and reusability of multidimensional languages but retains SQL semantics. Measure invocations can be expanded in place to simple, clear SQL.
To define the evaluation semantics for measures, we introduce context-sensitive expressions (a way to evaluate multidimensional expressions that is consistent with existing SQL semantics), a concept called evaluation context, and several operations for setting and modifying the evaluation context.
A talk at SIGMOD, June 9–15, 2024, Santiago, Chile
Authors: Julian Hyde (Google) and John Fremlin (Google)
https://doi.org/10.1145/3626246.3653374
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
Malibou Pitch Deck For Its €3M Seed Roundsjcobrien
French start-up Malibou raised a €3 million Seed Round to develop its payroll and human resources
management platform for VSEs and SMEs. The financing round was led by investors Breega, Y Combinator, and FCVC.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfVALiNTRY360
Salesforce Healthcare CRM, implemented by VALiNTRY360, revolutionizes patient management by enhancing patient engagement, streamlining administrative processes, and improving care coordination. Its advanced analytics, robust security, and seamless integration with telehealth services ensure that healthcare providers can deliver personalized, efficient, and secure patient care. By automating routine tasks and providing actionable insights, Salesforce Healthcare CRM enables healthcare providers to focus on delivering high-quality care, leading to better patient outcomes and higher satisfaction. VALiNTRY360's expertise ensures a tailored solution that meets the unique needs of any healthcare practice, from small clinics to large hospital systems.
For more info visit us https://valintry360.com/solutions/health-life-sciences
What to do when you have a perfect model for your software but you are constrained by an imperfect business model?
This talk explores the challenges of bringing modelling rigour to the business and strategy levels, and talking to your non-technical counterparts in the process.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Drona Infotech is a premier mobile app development company in Noida, providing cutting-edge solutions for businesses.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
19. #3 - Klasyczna obsługa żądań
Routes
/api/article GET index
/api/article POST store
20. #3 - Klasyczna obsługa żądań
Routes Middleware
/api/article GET index
/api/article POST store
21. #3 - Klasyczna obsługa żądań
Routes Middleware
/api/article GET index
/api/article POST store
allow or deny
22. #3 - Klasyczna obsługa żądań
Routes Middleware Controller
/api/article GET index
/api/article POST store
allow or deny
23. #3 - Klasyczna obsługa żądań
Routes Middleware Controller
/api/article GET index
/api/article POST store
allow or deny
get request
handle request
do some stuff
return response
24. #3 - Klasyczna obsługa żądań
Routes Middleware Controller
/api/article GET index
/api/article POST store
allow or deny
get request
handle request
do some stuff
return response
25. #3 - Klasyczna obsługa żądań
namespace AppHttpControllersEventController;
use AppHttpControllersController;
use IlluminateHttpRequest;
class EventController extends Controller
{
}
26. #3 - Klasyczna obsługa żądań
namespace AppHttpControllersEventController;
use AppHttpControllersController;
use IlluminateHttpRequest;
class EventController extends Controller
{
}
27. #3 - Klasyczna obsługa żądań
public function __construct() {}
public function index() {} //GET
public function create() {} //GET
public function store() {} //POST
public function edit() {} //GET
public function update() {} //PUT/PATCH
public function destroy() {} //DELETE
28. #3 - Klasyczna obsługa żądań
public function store(Request $request) {
}
29. #3 - Klasyczna obsługa żądań
public function store(Request $request) {
}
Dependency Injection
30. #3 - Klasyczna obsługa żądań
public function store() {
$request = request();
}
31. #3 - Klasyczna obsługa żądań
public function store() {
$request = request();
}
Current instance of Request
32. #3 - Klasyczna obsługa żądań
public function store(Request $request) {
//authorize the request access(?)
//check if the request has valid data
//store the event member
//give some response
}
33. #3 - Klasyczna obsługa żądań
//authorize the request access(?)
abort_if(!$request->ajax(), 403);
//check if request has valid data
$request->validate([
'first_name' => 'required|max:191',
'last_name' => 'required|max:191',
'department_id' => 'required|exists:departments,id',
'note' => 'max:512',
]);
//store the event member
EventMember::create($request->all());
//give some response
return [
‘success’ => true,
];
34. #4 - Form Request
● Klasa dziedzicząca z klasy Request
● Posiada wbudowaną logikę walidacji
● Autoryzacja dostępu do wykonania żądania
● Czy pozwala na więcej?!
35. #4 - Form Request
Routes Middleware Controller
/api/article GET index
/api/article POST store
allow or deny
get request
handle request
do some stuff
return response
36. #4 - Form Request
Routes Middleware Controller
/api/article GET index
/api/article POST store
allow or deny
get request
do some stuff
return response
Form
Request
handle request
- validation
- authorization
37. #4 - Form Request
Routes Middleware Controller
/api/article GET index
/api/article POST store
allow or deny
get request
do some stuff
return response
Form
Request
handle request
- validation
- authorization
38. #4 - Form Request
php artisan make:request StoreEventMemberRequest
39. #4 - Form Request
namespace AppHttpRequests;
use IlluminateFoundationHttpFormRequest;
class StoreEventMemberRequest extends FormRequest
{
public function authorize()
{
return false;
}
public function rules()
{
return [
];
}
}
40. #4 - Form Request
class StoreEventMemberRequest extends FormRequest
{
public function authorize()
{
return true;
}
public function rules()
{
return [
];
}
}
41. #4 - Form Request
class StoreEventMemberRequest extends FormRequest
{
public function authorize()
{
return true;
}
}
42. #4 - Form Request
class StoreEventMemberRequest extends FormRequest
{
public function authorize()
{
return $this->ajax();
}
}
true => access
false => 403
43. #4 - Form Request
class StoreEventMemberRequest extends FormRequest
{
public function authorize()
{
return $this->ajax();
}
} protected function failedAuthorization()
{
throw new HttpResponseException($this->forbiddenResponse());
}
true => access
false => 403
44. #4 - Form Request
class StoreEventMemberRequest extends FormRequest
{
public function authorize()
{
return true;
}
public function rules()
{
return [
'first_name' => 'required|max:191',
'last_name' => 'required|max:191',
'department_id' => 'required|exists:departments,id',
'note' => 'max:512',
];
}
}
45. #4 - Form Request
public function messages()
{
return [
‘first_name.required’ => ‘Your first name is required’,
‘last_name.required’ => ‘Your last name is required’,
];
}
46. #4 - Form Request
public function attributes()
{
return [
‘first_name’ => ‘Your first name’,
‘last_name’ => ‘Your last name’,
];
}
47. #4 - Form Request
public function withValidator($validator)
{
$validator->after(function ($validator) {
if ($this->somethingElseIsInvalid()) {
$validator->errors()->add('field', 'Something is wrong with this field!');
}
});
}
48. #4 - Form Request
use AppHttpControllersController;
use IlluminateHttpRequest;
use AppHttpRequestsStoreEventMemberRequest;
class EventController extends Controller
{
}
49. #4 - Form Request
public function store(StoreEventMemberRequest $request)
{
//authorize the request access(?)
//check if request has valid data
//store the event member
//give some response
}
50. #4 - Form Request
//authorize the request access(?)
abort_if(!$request->ajax(), 403);
//check if request has valid data
$request->validate([
'first_name' => 'required|max:191',
'last_name' => 'required|max:191',
'department_id' => 'required|exists:departments,id',
'note' => 'max:512',
]);
//store the event member
EventMember::create($request->all());
//give some response
return [
‘success’ => true,
];
51. #4 - Form Request
//authorize the request access(?)
abort_if(!$request->ajax(), 403);
//check if request has valid data
$request->validate([
'first_name' => 'required|max:191',
'last_name' => 'required|max:191',
'department_id' => 'required|exists:departments,id',
'note' => 'max:512',
]);
//store the event member
EventMember::create($request->all());
//give some response
return [
‘success’ => true,
];
52. #4 - Form Request
public function store(StoreEventMemberRequest $request) {
EventMember::create($request->all());
return [
‘success’ => true,
];
}
55. #4 - Form Request
● Oczyszczanie danych formularza (sanitizing)
● Manipulacja danymi formularza (handling)
● Logowanie zdarzeń (logging)
56. #5 - Zastosowanie Form Request w projekcie
● Oczyszczanie danych formularza (sanitizing)
● Manipulacja danymi formularza (handling)
● Logowanie zdarzeń (logging)
57. #5 - Zastosowanie Form Request w projekcie
public function all()
{
}
58. #5 - Zastosowanie Form Request w projekcie
public function all()
{
$attributes = parent::all();
return collect($attributes)
->map(function($field) {
return $field ?? filter_var($field,
FILTER_SANITIZE_STRING);
})
->all();
}
59. #5 - Zastosowanie Form Request w projekcie
public function all()
{
$attributes = parent::all();
return collect($attributes)
->map(function($field) {
return $field ?? filter_var($field,
FILTER_SANITIZE_STRING);
})
->all();
}
$_POST[‘data’] = [...];
422 (Unprocessable Entity)
60. #5 - Zastosowanie Form Request w projekcie
public function all()
{
$attributes = parent::all();
return collect($attributes)
->map(function($field) {
return $field ?? filter_var($field,
FILTER_SANITIZE_STRING);
})
->all();
}
$_POST[‘data’] = [...];
422 (Unprocessable Entity)
public function response(array $errors)
{
if ($this->ajax() || $this->wantsJson()) {
return new JsonResponse($errors, 422);
}
return $this->redirector->to($this->getRedirectUrl())
->withInput($this->except($this->dontFlash))
->withErrors($errors, $this->errorBag);
}
61. #5 - Zastosowanie Form Request w projekcie
public function all()
{
$attributes = parent::all();
return $this->sanitizeAttributes($attributes);
}
$_POST[‘data’] = [...];
protected function sanitizeAttributes($attributes) {
return collect($attributes)
->map(function($field) {
return $field ?? filter_var($field,
FILTER_SANITIZE_STRING);
})
->all();
}
62. #5 - Zastosowanie Form Request w projekcie
public function all()
{
$attributes = $this->input('data');
$attributes['token'] = $this->input('token');
return $this->sanitizeAttributes($attributes);
}
63. #5 - Zastosowanie Form Request w projekcie
public function all()
{
return $this->sanitizeAttributes($this->handleAttributes());
}
protected function handleAttributes() {
$attributes = $this->input('data');
$attributes['token'] = $this-
>input('token');
return $attributes;
}
64. #5 - Zastosowanie Form Request w projekcie
public function all()
{
return $this->sanitizeAttributes($this->handleAttributes());
}
protected function handleAttributes() {
if(!$this->has(‘data’)) {
return parent::all();
}
$attributes = $this->input('data');
$attributes['token'] = $this->input('token');
return $attributes;
}
wskazuje na kontroller/metoda
weryfikuje sposób przesyłania danych / post, get, etc.
umożliwia walidację przesyłanych zmiennych - wzorce
tworzenie nazw routów -> generowanie urli
Middleware - warstwa aplikacji, która jest odpowiedzialna za filtrowanie żądania HTTP, middleware może również być wykorzystywany przy response
dodanie nagłówków
logowanie zdarzeń
wskazanie middleware w routes
handle request - validation, auth, do some stuff
routes + middleware = mur obronny
ale skupmy się na kontrolerze
REST API schema
Wstrzykiwanie zależności (ang. Dependency Injection, DI) – wzorzec projektowy i wzorzec architektury oprogramowania polegający na usuwaniu bezpośrednich zależności pomiędzy komponentami na rzecz architektury typu plug-in. Polega na przekazywaniu gotowych, utworzonych instancji obiektów udostępniających swoje metody i właściwości obiektom, które z nich korzystają (np. jako parametry konstruktora). Stanowi alternatywę do podejścia, gdzie obiekty tworzą instancję obiektów, z których korzystają np. we własnym konstruktorze.
Posiada wbudowaną logikę walidacji
ustalanie reguł
tworzenie custom rules
tworzenie custom messages on fail
tworzenie custom response on fail
form request - ma właściwości middleware i przejmuje zadanie kontrollera
Determine if the user is authorized to make this request
Determine if the user is authorized to make this request
Determine if the user is authorized to make this request
Adding After Hooks To Form Requests
tu również pokazać, że mogłaby być dodatkowa weryfikacja, czy user może wykonać daną akcję, czy zapytanie jest ajaxowe etc.
tak wygląda kod bez form request
kod po zastosowaniu form request
czy możemy zastosować form request do czegoś jeszcze? pytanie do słuchaczy
czy możemy zastosować form request do czegoś jeszcze? pytanie do słuchaczy
metoda Request all()
FILTER_SANITIZE_STRING = Strip tags, optionally strip or encode special characters
The server understands the content type of the request entity (hence a 415 Unsupported Media Type status code is inappropriate), and the syntax of the request entity is correct (thus a 400 Bad Request status code is inappropriate) but was unable to process the contained instructions.
For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions.
Clean code: mniej kodu, rozdzielenie metod
SRP (Zasada jednej odpowiedzialności) Klasa powinna mieć tylko jedną odpowiedzialność (nigdy nie powinien istnieć więcej niż jeden powód do modyfikacji klasy).
Clean code: mniej kodu, rozdzielenie metod
SRP (Zasada jednej odpowiedzialności) Klasa powinna mieć tylko jedną odpowiedzialność (nigdy nie powinien istnieć więcej niż jeden powód do modyfikacji klasy).