i'm using pawlox/video-thumbnail but got error 'Class not Found'.
this is my Gallery controller
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Input;
use Illuminate\Http\Request;
use App\Gallery_model;
use App\Gallery_image_model;
use App\Search_index_model;
use DB;
use File;
use Storage;
use URL;
use Image;
use Mail;
use VideoThumbnail;
this is my config/app.php file
in providers array i do
Pawlox\VideoThumbnail\VideoThumbnailServiceProvider::class,
in aliases array i do
'VideoThumbnail' => Pawlox\VideoThumbnail\Facade\VideoThumbnail::class
i publish package config file also but still got error..
Related
Route::get('/biller-
info','MyDomain\Http\Controllers\BillPaymentController#getBillerInfo');
All other routes for api are created like this.
Getting exception Target class [Mydomain\Http\Controllers\BillPaymentController] does not exist.
guzzlehttps is installed.
route - 127.0.0.1/biller-info
path - api > packages > mydomain-shop > src > Http > Controllers > BillPaymentController.php
BillPaymentController.php
<?php
namespace MyDomain\Http\Controllers;
use Exception;
use Illuminate\Http\Request;
use MyDomain\Enums\Permission;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use MyDomain\Exceptions\MyDomainException;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Http;
class BillPaymentController extends CoreController
{
public function getBillerInfo()
{
$response = Http::get('https://reqres.in/api/products/3');
dd($response->collect());
}
}
Loading configuration files and clearing cache did the TRICK!!
composer dump-autoload
php artisan route:clear
I'm developing an eccomerce site. and im getting this error on checkout. please help
here are the defined routes:
//payfast payment
Route::get('payment', 'PaymentController#confirmpayment')->name('confirmPayment');
Route::get('/payfast/success','PaymentController#success')->name('payment.success');
Route::get('/payfast/cancel','PaymentController#cancel')->name('payment.cancel');
and here is the Controller (destination route):
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use NunoMaduro\Collision\Provider;
use App\Models\Cart;
use App\Models\Product;
use DB;
use Billow\Contracts\PaymentProcessor;
Class PaymentController extends Controller
{
public function confirmpayment(PaymentProcessor $payfast)
{
$cart = Cart::where('user_id',auth()->user()->id)->where('order_id',null)->get()->toArray();
$data = [];
When you use Laravel Named Route name(), you have to use it.
Route::get('payment', 'PaymentController#confirmpayment')->name('confirmPayment');
Instead of using
payment
replace it with
confirmPayment
change your HTTP method from get to post
like this:
Route::post('payment', 'PaymentController#confirmpayment')->name('confirmPayment')
it seems you don't have route named payment you only have
confirmPayment
payment.success
payment.cancel
In Category.php
namespace App;
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
and in Controller.php
namespace App\Http\Controllers;
use App\Models\Category;
use App\Setting;
use App\Post;
use function GuzzleHttp\Promise\all;
use Illuminate\Http\Request;
First Change from use App\Category; to use Category, to use \Category, to use App\Models\Category.
Second composer dump-autoload.
You are using two namespace in Category.php
namespace App; //REMOVE THIS If model file is in app\Models folder
namespace App\Models; // Remove this if model file is in app(root) folder
use Illuminate\Database\Eloquent\Model;
class Category extends Model {......}
Include it in your class dependencies:
use App\Category;
I want to use Logto log ,it works in controller,but it doesn't work in application(vendor/laravel/framework/src/Illuminate/Foundation/Application.php)
this is my code:
<?php
namespace Illuminate\Foundation;
use Log;
use Closure;
use RuntimeException;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use Illuminate\Container\Container;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\ServiceProvider;
use Illuminate\Events\EventServiceProvider;
use Illuminate\Routing\RoutingServiceProvider;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Contracts\Foundation\Application as ApplicationContract;
class Application extends Container implements ApplicationContract, HttpKernelInterface
{
public function make($abstract, array $parameters = [])
{
$abstract = $this->getAlias($abstract);
if (isset($this->deferredServices[$abstract])) {
$this->loadDeferredProvider($abstract);
}
Log::info('test info '); // 698 line
return parent::make($abstract, $parameters);
}
I catch the error when I up the artisan serve:
php artisan serve
Fatal error: Class 'Log' not found in vendor/laravel/framework/src/Illuminate/Foundation/Application. php on line 698
In my web browser I am getting this error:
FatalErrorException in UserController.php line 18:
Class 'App\Report'
not found
It seems that UserControler.php page cannot find report.php page.
Here is my folder structure:
lumen
-api
--report.php // file where model Report is
---Http
----Controller
------UserController.php // file where i get error
-bootstrap
- ...
Header of UserController.php
namespace App\Http\Controllers;
use Illuminate\Database\Schema\Blueprint;
use App\Report; // it seems here is problem
use App\User; // with user model is same problem
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use DB;
class UserController extends Controller {
...
Header of report.php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Report extends Model {
...
I am using Apache, Ubuntu, PHP 5.5 with Lumen framework
First of all model file name should be same as your class name here
lumen
-api
--report.php // This should be Report.php
---Http
----Controller
------UserController.php // file where i get error
-bootstrap
- ...
Also your Report.php Model will be under app directory same directory where your User Model resides