Skip to content

Commit

Permalink
Structure update
Browse files Browse the repository at this point in the history
  • Loading branch information
Elkasovic Nermin committed Mar 29, 2020
1 parent 0bd0962 commit e9d0779
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"extra": {
"laravel": {
"providers": [
"LaravelFullCalendar\\ServiceProvider"
"LaravelFullCalendar\\FullCalendarServiceProvider"
],
"aliases": {
"Calendar": "LaravelFullCalendar\\Facades\\Calendar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use ArrayAccess;
use DateTime;
use Illuminate\View\Factory;
use Illuminate\Support\Str;

class Calendar
{
Expand Down Expand Up @@ -128,7 +129,7 @@ public function getId()
return $this->id;
}

$this->id = str_random(8);
$this->id = Str::random(8)

return $this->id;
}
Expand Down Expand Up @@ -268,6 +269,7 @@ protected function replaceCallbackPlaceholders($json, $placeholders)
$replace[] = $this->getCallbacks()[$name];
}

return str_replace($search, $replace, $json);
//return str_replace($search, $replace, $json);
return Str::replaceArray($search, $replace, $json);
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace LaravelFullCalendar;

use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Illuminate\Support\ServiceProvider;

class ServiceProvider extends BaseServiceProvider
class FullCalendarServiceProvider extends ServiceProvider
{

/**
Expand All @@ -14,9 +14,16 @@ class ServiceProvider extends BaseServiceProvider
*/
public function register()
{
$this->app->bind('laravel-full-calendar', function ($app) {
/*$this->app->bind('laravel-full-calendar', function ($app) {
return $app->make('LaravelFullCalendar\Calendar');
});*/

$this->app->singleton('laravel-full-calendar', function ($app) {
return new Calendar($app['request']->server());
});

$this->app->alias('laravel-full-calendar', Calendar::class);

}

public function boot()
Expand All @@ -31,6 +38,7 @@ public function boot()
*/
public function provides()
{
return ['laravel-full-calendar'];
//return ['laravel-full-calendar'];
return ['laravel-full-calendar', Calendar::class];
}
}
File renamed without changes.
File renamed without changes.

0 comments on commit e9d0779

Please sign in to comment.