export default function({ store, redirect }) {
if (store.state.auth.user.role_id === 0) {
return redirect("/");
}
}
if(auth()->user()->role_id != 0) {
return $next($request);
} else {
return response()->json(['error' => 'Вы не админ!']);
}
<VirtualHost 165.22.69.224:80>
ServerAdmin info@site.kz
ServerName site.kz
DocumentRoot /var/www/site.kz/html/public
ErrorLog /var/www/site.kz/logs/error.log
CustomLog /var/www/site.kz/logs/access.log combined
<Directory /var/www/site.kz/html/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =site.kz
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost [2a03:b0c0:3:e0::5d:f001]:80>
ServerAdmin info@site.kz
ServerName site.kz
DocumentRoot /var/www/site.kz/html/public
ErrorLog /var/www/site.kz/logs/error.log
CustomLog /var/www/site.kz/logs/access.log combined
<Directory /var/www/site.kz/html/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =site.kz
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
$user = User::find($id);
$categories = [];
foreach ($user->categories as $category) {
$categories[] = $category->id;
}
return Tender::where('published_at', '<', Carbon::now())
->where('date_end', '>', Carbon::now())
->whereIn('category', $categories)
->where('status', true)
->with(['rates'])
->orderBy('id', 'DESC')
->get();