How to use Swagger For Laravel 5.4? - laravel-5

I have a web service on Laravel 5.,4 but I need a documentation about it. I was looking options, and it seems like Swagger is one of the best options for this (if you have any other recommendation please let me know). However, I can see a lot of versions of it, I was looking into the official page but I donĀ“t sure what I need to implement.
I will appreciate if you can give some suggestions or examples about it.

Install darkaonline/l5-swagger:
composer require "darkaonline/l5-swagger:~5.0"
Write correct phpdoc annotations for swagger (example: https://github.com/zircote/swagger-php/tree/master/Examples/petstore.swagger.io)
Then run:
php artisan l5-swagger:publish
http://yourhost.dev/api/documentation will show you swagger-ui

Related

how to use Stripe in laravel without using composer?

my project has been done with laravel 7 and its on a real host with cpanel as server software.
I want to online payment to website and I think Stripe is the best option but I cant figure it out how to use it without composer.
in every tutorial people used composer commands for doing this automatically, but in my case I have to put files one by one and update files.
I asked host provider about giving me composer ability on apache, but they said they cant so I have to do every thing manually.
I would be very glad if you could help me in this.
You do not need the Composer in your Hosting-Environment, If you have it in your Local-Environment then you will have the files already installed on your server. You could try Homestead what is already a pre-configured local-development environment for Laravel.
Composer is only a dependency-management-system, what makes you really easier to use open-source-code from other third party providers like the STRIPE-SDK.
But you can also use Stripes RAW REST-API's without the SDK, but it would be much more work - you can for example extract the needed parameters from the curl-example of stripe, but also if you use this direct way It would be easier to use a Curl-Wrapper-Library like Guzzle.
You should really have a deeper look into the composer, because if you want to use & contribute with some community-projects you need composer.
BTW: when you install laravel from scratch, then you still use the composer, as you see here.
While Composer is the recommended option, Stripe supports manual installation by downloading a specific version of their library and including it directly. It's also covered directly on their readme page here: https://github.com/stripe/stripe-php#manual-installation
You install the library locally by downloading the latest release and unzipping it, you add this to your own code and then you include the library like this:
require_once('/path/to/stripe-php/init.php');

Creating Laravel Forum with Chatter Package

I have followed each step from https://github.com/thedevdojo/chatter but got error during migration, as well as php artisan db:seed --class=ChatterTableSeeder command also didnt worked
I forked the original Chatter repository (it was left out) as a base and created a completely new, single-page forum using Laravel resources API, Tailwind CSS and Vue.js. It's easy to install and easier to extend.
Check it at Chatter-laravel/core and check a demo here
Laravel packages help any website in so many ways. Their implementation provides you with plenty of benefits.
To help you with the Laravel Packages, Here are Top 35+ Useful Laravel Packages to Improve Website Performance
Thank you!

How to use Queues in Laravel Project Code without Artisan commands?

I am learning Queues in Laravel I want a practical learning I didnt get exactly what i want still. Please anyone explain me about this.
You should take reference from below URL.
https://scotch.io/tutorials/why-laravel-queues-are-awesome

Route not defined using Laravel MVC PHP Storm

enter image description here
I get this error in PHP storm. I am learning Laravel and can someone please help me with this error. The route is not defined.
Please see the attached screenshot.
No worries. Php-storm doesn't see some of the laravel facades static classes. (e.g. 'Route::', 'Auth::'). Your code will still run fine (provided there aren't any real problems).
PS - If you haven't done it yet, install the phpstorm laravel plugin. It will help eliminate some of these issues (but not all).
Have fun!

Customizing the paginator view in Laravel 5.2

I've been reading the docs and set up a basic app.
Every issue I've had before I've been able to solve by looking in the docs and occasionally using Google, however I can't figure this one out.
I'm using Laravel version 5.2.43 and the Paginator works fine.
I use it in my view like this,
$data->links()
But now I would like to customize the look of the paginator.
So I tried running this command
php artisan vendor:publish --tag=laravel-pagination
In the hopes of simply being able to customize that view instead of creating a new one all over but that command didn't work, it just said
Nothing to publish for tag [laravel-pagination]
So, instead I did this.
{{ $data->links('folder.viewName') }}
But this command gives me this error,
Argument 1 passed to Illuminate\Pagination\LengthAwarePaginator::links() must be an instance of Illuminate\Contracts\Pagination\Presenter, string given
So I'm not sure what's going on. The pagination works but I can't set the view myself.
Any thoughts on what's going on here?
Any help would be greatly appreciated.
I believe you can't do this in Laravel 5.2 without "hacking" the framework. Fortunately, Laravel 5.3 is released this week and it features custom pagination views
Custom pagination in Laravel 5.3
So it turns out I've been reading the 5.3 documentation for Laravel all this time. Which explains a lot of things...
So when 5.3 comes out we can do
$paginator->links("myOwnView")
Until then, I've done it the manual way of using the instances inside the paginator object.

Resources