Posts

Since 2024
Resources for Getting Up To Speed with Laravel 11
Resources for Getting Up To Speed with Laravel 11

Now that Laravel 11 is out, we wanted to share some resources from the community for getting up-to-speed with Laravel 11. Whether you’re a seasoned Laravel developer or just stepping into the world of web development, we’ve hand-picked some content we think will help you get up to speed quickly: Laravel 11 Highlights in 90 Seconds If you’re already familiar with Laravel, we walk you through Laravel 11 highlights in 90 seconds: <iframe width="560" height="315" src="https://www.youtube.com/embed/f41juaJMxKE?si=-pD8L-jK3TwyJ_41" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> Dive Into the Streamlined Directory Structure in Laravel 11 Our Dive into the Streamlined Directory Structure in Laravel 11 article walks you through the latest Laravel skeleton directory structure when setting up a new Laravel 11 application. <iframe width="560" height="315" src="https://www.youtube.com/embed/lQSEBvxuXiU?si=gstIKUy4OLMao8Bg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> Welcome to Laravel 11 Over on the official Laravel YouTube channel, Christoph Rumpel walks through new features that landed in this week’s Laravel 11 release: <iframe width="560" height="315" src="https://www.youtube.com/embed/rmMCiP-iVYM?si=2rFDo4jOhx5fVZ6g" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> Laravel 11 is Here by Josh Cirre Josh Cirre’s video Laravel 11 is Here (and I'm so excited) is another excellent roundup of high-level features released with Laravel 11: <iframe width="560" height="315" src="https://www.youtube.com/embed/IEVufZPXzBo?si=fFvV8D37UWnpqB-F" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> Laracasts: 30 Days to Learn Laravel Laracasts has updated their free Laravel course to Laravel 11, 30 Days to Learn Laravel. You’ll learn Laravel from scratch in one month, one video per day, and learn everything you need to start building Laravel apps. This is a free course that anyone can watch! Laravel Reverb Documentation Laravel Reverb, a first-party WebSocket server for Laravel applications, launched with Laravel 11 as well. The full documentation for getting started with Reverb is now available in the official documentation. It will walk you through installing, setting up, and running the Reverb server in production. <iframe width="560" height="315" src="https://www.youtube.com/embed/TkYXIHgdrgA?si=lOlgORQ2yzpFSJ2y" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> The Laravel Reverb website is beautiful, so check it out for a quick overview of Reverb, along with links to the documentation. Upgrade to Laravel 11 with Shift You can automate the Upgrade of Laravel 10.x to Laravel 11.x with Laravel Shift. This is an amazing way to speed up the upgrade process and get those existing Laravel applications running on the latest version of Laravel. Laravel News creator Eric Barnes demonstrates upgrading laravel-news.com to Laravel 11 using the amazing Shift service: <iframe width="560" height="315" src="https://www.youtube.com/embed/Z6aY9FfY5eI?si=9hh-F5U_xj6kB-u2" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> The Laravel 11 shift includes streamlining your configuration files to their true customizations, consolidating service providers, getting your app to reflect the Laravel 11 application structure updates, and more. Check out the Shift demo video for some additional insight. Laravel 11 Documentation Prologue Each Laravel release contains a Prologue section, which contains Release Notes, an Upgrade Guide, and a Contribution Guide. Using Laravel Shift is the best way to upgrade, but reading through the release notes and upgrade guide is an excellent way to familiarize yourself with changes to the latest Laravel version. A quick way to stay current with Laravel releases is the laravelversions.com website (and their APIs) so that you always know where to go to find dates for release, end of bug fixes, and end of security updates for Laravel & PHP. Hat tip to Matt Stauffer, who helps maintain laravelversions.com and phpreleases.com. At the time of release, here’s an updated support policy: Learn More On our Laravel News YouTube channel, we have a Laravel 11 playlist for everything we've published leading up to the release of Laravel 11. We’d love to hear what you’re building with Laravel! The post Resources for Getting Up To Speed with Laravel 11 appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

Statamic announces next Flat Camp retreat (EU edition)
Statamic announces next Flat Camp retreat (EU edition)

Statamic's Flat Camp is an unforgettable, relationship-focused retreat for the Statamic and Laravel community. Happening June 11-14, 2024, and set in the idyllic Italian countryside, right outside Rome, surrounded by beautiful scenery, we talk both business and non-business. Spend time with the gentlemen from the Statamic Core team, meet those lovely people from the community IRL, influence the future roadmap, and talk about operating your freelance or agency business to peers, all while sitting by the pool, having lunch or dinner cooked by a private chef, and more! It's a different experience compared to a regular conference you might have attended in the past. You won't need a hotel since the accommodation is included in the ticket as well. This is all part of the experience. Read the recap of last year's retreat over on the Statamic blog or relive some of the magic by watching the recap video. <iframe width="939" height="528" src="https://www.youtube.com/embed/x1kzmJFGTJA" title="Flat Camp 2023" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> It truly was a unique get-together last year. Still need convincing after watching that recap video? Let Jack, founder of Statamic, tell you why you (and/or your colleagues) should come. <iframe width="939" height="528" src="https://www.youtube.com/embed/RHttx8q1VOk" title="Why you should come to Flat Camp – The Statamic Non-Conf" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> Flat Camp is limited to 50 guests and a ticket includes: 3 Nights lodging in our own private Italian villa Private chef will prepare us breakfast, lunch, and dinner Access to all workshops, intimate talks, and wine cellar chats Exclusive Statamic/Flat Camp swag Other mysteries and surprises For complete details and tickets, head over to the Flat Camp site. The post Statamic announces next Flat Camp retreat (EU edition) appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

Tablar Kit: UI Components for Tablar Admin Dashboards
Tablar Kit: UI Components for Tablar Admin Dashboards

The Tablar Kit package for Laravel adds a UI kit for your Tablar admin dashboard. This UI kit adds many easy-to-use components, making your dashboard more visually appealing and user-friendly. It's all about simplicity and enhancing your experience with Laravel Tablar: Standard Form Components: Includes text fields, radio selections, checkboxes, and secure password inputs, along with datepicker & custom buttons. Tailored for efficient data entry and user interaction. Advanced Dropdown: Includes both standard and dependent Dropdown, suitable for dropdown data relationships. File Upload with On-the-Fly Image Editing: This feature not only simplifies the file uploading process but uniquely offers on-the-fly image editing capabilities, adding a layer of convenience and efficiency to your workflow. Optimized Data Tables with Export Options: The data table component not only organizes and displays information but also enables data export in formats such as CSV, XLS, PDF, and HTML, catering to diverse data analysis and reporting needs. Rich Text Editor with File Upload and Browser Features: Enhance your content creation with an editor that supports seamless file uploads. It includes a file browser feature, ensuring a comprehensive and uninterrupted content creation process. Responsive and Customizable Design: Each component in the Tablar Kit is built to be fully responsive, ensuring compatibility with various screen sizes. Moreover, customization options abound, allowing you to align each component with your application's theme, including support for dark mode. The Tablar UI Kit provides Laravel Blade components and the required JavaScript code for components to function. For example, you can easily add date pickers, file uploads, WYSIWYG editors, and more using premade components to your Tablar dashboards: {{-- Datepickers --}} <x-flat-picker name="admission_date"></x-flat-picker> <x-lite-picker name="admission_date"></x-lite-picker> {{-- File uploader --}} <x-filepond name="profile_image"/> {{-- Jodit editor (https://xdsoft.net/jodit/) --}} <x-jodit name="editor"></x-jodit> {{-- More at https://tablar.ebuz.xyz/docs/11.0/components --}} You can learn more about this package, get full installation instructions, and view the source code on GitHub. Also, you can view the Tablar Kit documentation to get familiar with the UI components. This package requires the Tablar Laravel Admin Template, which you can learn about here. The post Tablar Kit: UI Components for Tablar Admin Dashboards appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

Easily create complex database queries with the Query Enrich Package
Easily create complex database queries with the Query Enrich Package

Laravel Query Enrich is designed to easily create complex database queries in Laravel without having to write complicated SQL code. Here are some examples taken from the readme: Example of fetching orders placed in the last 7 days With Laravel Query Enrich $recentOrders = DB::table('orders') ->where(c('created_at'), '>=', QE::subDate(QE::now(), 7, Unit::DAY)) ->get(); Without Laravel Query Enrich $recentOrders = DB::table('orders') ->whereRaw('created_at >= NOW() - INTERVAL ? DAY', 7) ->get(); Raw Query SELECT * FROM `orders` WHERE `created_at` >= NOW() - INTERVAL 7 DAY; Using the avg function for grabbing the average monthly price for oil and gas With Laravel Query Enrich $monthlyPrices = DB::table('prices') ->select( QE::avg(c('oil'))->as('oil'), QE::avg(c('gas'))->as('gas'), 'month' ) ->groupBy('month') ->get(); Without Laravel Query Enrich $monthlyPrices = DB::table('prices') ->select(DB::raw('avg(`oil`) as `oil`, avg(`gas`) as `gas`, `month`')) ->groupBy('month') ->get(); Raw Query select avg(`oil`) as `oil`, avg(`gas`) as `gas`, `month` from `prices` group by `month` Using an exists query With Laravel Query Enrich $authors = DB::table('authors')->select( 'id', 'first_name', 'last_name', QE::exists( Db::table('books')->where('books.author_id', c('authors.id')) )->as('has_book') )->orderBy( 'authors.id' )->get(); Without Laravel Query Enrich $authors = DB::table('authors') ->select( 'id', 'first_name', 'last_name', DB::raw('exists(select * from `books` where `books`.`author_id` = `authors`.`id`) as `has_book`')) ->orderBy( 'authors.id', ) ->get(); Raw Query select `id`, `first_name`, `last_name`, exists(select * from `books` where `books`.`author_id` = `authors`.`id`) as `result` from `authors` order by `authors`.`id` asc Getting a full name using concatws With Laravel Query Enrich $authors = Author::select( 'first_name', 'last_name', QE::concatWS(' ', c('first_name'), c('last_name'))->as('result') )->get(); Without Laravel Query Enrich $author = Author::select( 'first_name', 'last_name', DB::raw("concat_ws(' ', `first_name`, `last_name`) as `result`") )->first(); Raw Query select `first_name`, `last_name`, concat_ws(' ', `first_name`, `last_name`) as `result` from `authors` Check out the documentation for complete details and view the package on Github. The post Easily create complex database queries with the Query Enrich Package appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

Introducing the Context Facade in Laravel
Introducing the Context Facade in Laravel

Laravel added a new Context service to define contextual data to the current request. Context data is included in all log entries for that request, and queued jobs will also retain that same data. Using contextual data allows you to easily trace back code execution for a given request and any distributed flows in your application: // In a middleware... Context::add('hostname', gethostname()); Context::add('trace_id', (string) Str::uuid()); // In a controller... Log::info('Retrieving commit messages for repository [{repository}].', [ 'repository' => $repo, ]); Http::get('https://github.com/...'); /* Log entry example: [2024-01-19 04:20:06] production.INFO: Retrieving commit messages for repository [laravel/framework]. {"repository":"laravel/framework"} {"hostname":"prod-web-1","trace_id":"a158c456-d277-4214-badd-0f4c8e84df79"} */ Contextual data also supports concepts like stacks, where you can push data to the same context, effectively appending data: Event::listen(function (JobQueued $event) { Context::push('queued_job_history', "Job queued: {$event->job->displayName()}"); }); Context::get('queued_job_history'); // [ // "Job queued: App\Jobs\MyFirstJob", // "Job queued: App\Jobs\MySecondJob", // "Job queued: App\Jobs\MyThirdJob", // ] If you'd like to learn more about this feature, check out the Pull Request description. Hat tip to Tim MacDonald, who created this feature for the framework! The post Introducing the Context Facade in Laravel appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.