Multitenancy in Laravel
You can watch the video on the making of this example on https://youtu.be/592EgykFOz4
You can watch the video on the making of this example on https://youtu.be/592EgykFOz4
I have used it all according to the documentation and videos on youtube. Found it all working on web but errors when I run scheduled tasks.
Following are the errors:
Illuminate\Contracts\Container\BindingResolutionException: Exception 'Illuminate\Contracts\Container\BindingResolutionException' with message 'Target class [tenant] does not exist.' in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:832
in Illuminate\Container\Container::build called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php (712)
in Illuminate\Container\Container::resolve called at /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php (826)
in Illuminate\Foundation\Application::resolve called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php (651)
in Illuminate\Container\Container::make called at /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php (811)
in Illuminate\Foundation\Application::make called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php (1354)
in Illuminate\Container\Container::offsetGet called at /var/www/html/app/Providers/TenancyProvider.php (40)
in App\Providers\TenancyProvider::App\Providers\{closure} called at ? (?)
in call_user_func called at /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Queue.php (280)
in Illuminate\Queue\Queue::withCreatePayloadHooks called at /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Queue.php (151)
in Illuminate\Queue\Queue::createObjectPayload called at /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Queue.php (127)
in Illuminate\Queue\Queue::createPayloadArray called at /var/www/html/vendor/vladimir-yuldashev/laravel-queue-rabbitmq/src/Queue/RabbitMQQueue.php (567)
in VladimirYuldashev\LaravelQueueRabbitMQ\Queue\RabbitMQQueue::createPayloadArray called at /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Queue.php (105)
in Illuminate\Queue\Queue::createPayload called at /var/www/html/vendor/vladimir-yuldashev/laravel-queue-rabbitmq/src/Queue/RabbitMQQueue.php (125)
in VladimirYuldashev\LaravelQueueRabbitMQ\Queue\RabbitMQQueue::push called at /var/www/html/vendor/vladimir-yuldashev/laravel-queue-rabbitmq/src/Horizon/RabbitMQQueue.php (44)
in VladimirYuldashev\LaravelQueueRabbitMQ\Horizon\RabbitMQQueue::push called at /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Queue.php (57)
in Illuminate\Queue\Queue::pushOn called at /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php (244)
in Illuminate\Bus\Dispatcher::pushCommandToQueue called at /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php (227)
in Illuminate\Bus\Dispatcher::dispatchToQueue called at /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php (77)
in Illuminate\Bus\Dispatcher::dispatch called at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php (168)
in Illuminate\Console\Scheduling\Schedule::dispatchToQueue called at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php (140)
in Illuminate\Console\Scheduling\Schedule::Illuminate\Console\Scheduling\{closure} called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php (36)
in Closure::__invoke called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php (36)
in Illuminate\Container\BoundMethod::Illuminate\Container\{closure} called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php (40)
in Illuminate\Container\Util::unwrapIfClosure called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php (93)
in Illuminate\Container\BoundMethod::callBoundMethod called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php (37)
in Illuminate\Container\BoundMethod::call called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php (610)
in Illuminate\Container\Container::call called at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CallbackEvent.php (79)
in Illuminate\Console\Scheduling\CallbackEvent::run called at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php (143)
in Illuminate\Console\Scheduling\ScheduleRunCommand::runEvent called at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php (102)
in Illuminate\Console\Scheduling\ScheduleRunCommand::handle called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php (36)
in Illuminate\Container\BoundMethod::Illuminate\Container\{closure} called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php (40)
in Illuminate\Container\Util::unwrapIfClosure called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php (93)
in Illuminate\Container\BoundMethod::callBoundMethod called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php (37)
in Illuminate\Container\BoundMethod::call called at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php (610)
in Illuminate\Container\Container::call called at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php (136)
in Illuminate\Console\Command::execute called at /var/www/html/vendor/symfony/console/Command/Command.php (256)
in Symfony\Component\Console\Command\Command::run called at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php (121)
in Illuminate\Console\Command::run called at /var/www/html/vendor/symfony/console/Application.php (971)
in Symfony\Component\Console\Application::doRunCommand called at /var/www/html/vendor/symfony/console/Application.php (290)
in Symfony\Component\Console\Application::doRun called at /var/www/html/vendor/symfony/console/Application.php (166)
in Symfony\Component\Console\Application::run called at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php (93)
in Illuminate\Console\Application::run called at /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php (129)
in Illuminate\Foundation\Console\Kernel::handle called at /var/www/html/artisan (37)
Please suggest what can be done to run scheduled jobs?
Followed all instruction. Database PostgreSQL, migration done. everything worked fine.
But when i run php artisan serve it shows 404|not found
I couldn't run migration:rollback when using your TenantMigrationCommand, every time I am using php artisan tenants:migrate --fresh
and starting from the beginning. Is there an alternate way to rollback in your code or suggest how to do it. Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.