راکت
NESYOU
NESYOU
توسط NESYOU مطرح شد
1 پاسخ

پکیج Carbon

سلام من از تابع کاربن استفاده میکنم use هم میکنم ولی ارور میده نمیدونم مشکلش کجاست.
syntax error, unexpected 'printf' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST


namespace App\Http\Middleware;
use Carbon\Carbon;
use Closure;
use Illuminate\Http\Request;

class CheckTime
{
printf("Right now is %s", Carbon::now()->toDateTimeString());

// $now = Carbon::now();
// $start = Carbon::createFromTimeString('00:00');
// $end = Carbon::createFromTimeString('06:00');

if ($now->between($start, $end)) {
    return redirect('/')->with('limitTime, You cant write post at this time');
}

return $next($request);
public function handle(Request $request, Closure $next)
}