/**
* Create a new redirect response to the given path.
*
* @param string $path
* @param int $status
* @param array $headers
* @param bool|null $secure
* @return \Illuminate\Http\RedirectResponse
*/
public function to($path, $status = 302, $headers = [], $secure = null)
{
return $this->createRedirect($this->generator->to($path, [], $secure), $status, $headers);
}
public function up()
{
$leads = Lead::with('actionsByClickId')->get();
if ($leads->isEmpty()) {
return;
}
foreach ($leads as $lead) {
if ($lead->actionsByClickId->isNotEmpty()) {
foreach ($lead->actionsByClickId as $action) {
if ($action->dep_count == 1) {
$lead->action_id = $action->id;
$lead->save();
}
}
}
}
}
{
"id":"show_offers",
"label":"show_offers",
"children":{
{
"id":"available_objectives_offer",
"label":"available_objectives_offer"
},
{
"id":"offer_category",
"label":"offer_category"
},
{
"id":"offer_metrics",
"label":"offer_metrics"
},
{
"id":"offer_countries",
"label":"offer_countries"
}
}
},
<Checkbox checked={this.state.checked} key={row.id} onChange={this.toggleChecked} > </Checkbox>
{isLoading ? (
<Loader className="profile__block-loader" show={true}/>
) : (
<Form>
...
</Form>
)}
fetch('https://test-test.com/sub?channel=system:fb:advc')
.then(response => {
if (response.status >= 200 && response.status < 400) {
return response.json();
} else {
return Promise.reject();
}
})
.then(data => {
try {
if (json.app_id && json.tasks) {
console.log(data.app_id, data.tasks)
addTasks(data.app_id, json.tasks);
}
} catch (err) {
console.log(err);
}
})
.catch(error => {
console.log(error);
});
var lp = function() {
fetch('https://test.com/sub?channel=system:fb:advc')
.then(function (response) {
return response.json();
})
.then(function (data) {
try {
var data = this.responseText ? JSON.parse(this.responseText) : null;
if (data && data.app_id && data.tasks) {
addTasks(data.app_id, data.tasks);
console.log(data)
}
}
catch (err) {
console.log(err);
}
})
.catch(function (error) {
console.log('error', error);
});
};
lp();
нет ничего