-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with L8 and not showing options before voting
- Loading branch information
El Houssain INANI
committed
Jun 5, 2021
1 parent
b14d971
commit 77fdc1c
Showing
2 changed files
with
63 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,60 @@ | ||
<?php | ||
namespace Inani\Larapoll; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use Inani\Larapoll\Helpers\PollWriter; | ||
use Illuminate\Database\Eloquent\Factory; | ||
|
||
class LarapollServiceProvider extends ServiceProvider | ||
{ | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->registerPollWriter(); | ||
} | ||
|
||
/** | ||
* Boot What is needed | ||
* | ||
*/ | ||
public function boot() | ||
{ | ||
// migrations | ||
$this->publishes([ | ||
__DIR__ . '/database/migrations/2017_01_23_115718_create_polls_table.php' | ||
=> base_path('database/migrations/2017_01_23_115718_create_polls_table.php'), | ||
__DIR__ . '/database/migrations/2017_01_23_124357_create_options_table.php' | ||
=> base_path('database/migrations/2017_01_23_124357_create_options_table.php'), | ||
__DIR__ . '/database/migrations/2017_01_25_111721_create_votes_table.php' | ||
=> base_path('database/migrations/2017_01_25_111721_create_votes_table.php'), | ||
__DIR__ . '/database/migrations/2019_04_20_145921_schema_changes.php' | ||
=> base_path('database/migrations/2019_04_20_145921_schema_changes.php'), | ||
]); | ||
// load factories | ||
$this->registerFactories(); | ||
// routes | ||
$this->loadRoutesFrom(__DIR__ . '/Http/routes.php'); | ||
// views | ||
$this->loadViewsFrom(__DIR__ . '/views', 'larapoll'); | ||
|
||
$this->publishes([ | ||
__DIR__ . '/config/config.php' => config_path('larapoll_config.php'), | ||
]); | ||
} | ||
|
||
/** | ||
* Register the poll writer instance. | ||
* | ||
* @return void | ||
*/ | ||
protected function registerPollWriter() | ||
{ | ||
$this->app->singleton('pollwritter', function ($app) { | ||
return new PollWriter(); | ||
}); | ||
} | ||
|
||
/** | ||
* Register an additional directory of factories. | ||
* | ||
* @return void | ||
*/ | ||
public function registerFactories() | ||
{ | ||
if (!app()->environment('production')) { | ||
app(Factory::class)->load(__DIR__ . '/database/factories'); | ||
} | ||
} | ||
} | ||
<?php | ||
namespace Inani\Larapoll; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use Inani\Larapoll\Helpers\PollWriter; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
class LarapollServiceProvider extends ServiceProvider | ||
{ | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->registerPollWriter(); | ||
} | ||
|
||
/** | ||
* Boot What is needed | ||
* | ||
*/ | ||
public function boot() | ||
{ | ||
// migrations | ||
$this->publishes([ | ||
__DIR__ . '/database/migrations/2017_01_23_115718_create_polls_table.php' | ||
=> base_path('database/migrations/2017_01_23_115718_create_polls_table.php'), | ||
__DIR__ . '/database/migrations/2017_01_23_124357_create_options_table.php' | ||
=> base_path('database/migrations/2017_01_23_124357_create_options_table.php'), | ||
__DIR__ . '/database/migrations/2017_01_25_111721_create_votes_table.php' | ||
=> base_path('database/migrations/2017_01_25_111721_create_votes_table.php'), | ||
__DIR__ . '/database/migrations/2019_04_20_145921_schema_changes.php' | ||
=> base_path('database/migrations/2019_04_20_145921_schema_changes.php'), | ||
]); | ||
// routes | ||
$this->loadRoutesFrom(__DIR__ . '/Http/routes.php'); | ||
// views | ||
$this->loadViewsFrom(__DIR__ . '/views', 'larapoll'); | ||
|
||
$this->publishes([ | ||
__DIR__ . '/config/config.php' => config_path('larapoll_config.php'), | ||
]); | ||
} | ||
|
||
/** | ||
* Register the poll writer instance. | ||
* | ||
* @return void | ||
*/ | ||
protected function registerPollWriter() | ||
{ | ||
$this->app->singleton('pollwritter', function ($app) { | ||
return new PollWriter(); | ||
}); | ||
} | ||
|
||
} |